Skip to content

Commit

Permalink
v1/token -> /v1/tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
pallavi2209 committed Dec 1, 2016
1 parent 475330f commit 1c26cb3
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 78 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ If Single Sign On (SSO) is configured in Refocus, SSO users can login using 'SSO
### Using API Access Tokens
- A token is required for API calls when Refocus config has `useAccessToken` set to `true`.
- New users should register to get API access token. A user can POST to the `/v1/register` endpoint to generate a token. Save this token for future use.
- Existing users can POST to the `/v1/token` endpoint to retrieve new token.
- Existing users can POST to the `/v1/tokens` endpoint to retrieve new token.
- To use the token for API access, add a Header with `Key:Authorization` and `Value: "token returned"` to your API call.
- When using [Postman](https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=en) to make an API call, set Body to raw and text to JSON.

Expand Down
4 changes: 2 additions & 2 deletions api/v1/controllers/token.js → api/v1/controllers/tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
*/

/**
* api/v1/controllers/token.js
* api/v1/controllers/tokens.js
*/
const httpStatus = require('../constants').httpStatus;
const u = require('../helpers/verbs/utils');
const apiErrors = require('../apiErrors');
const jwtUtil = require('../../../utils/jwtUtil');
const helper = require('../helpers/nouns/tokens');

const resourceName = 'token';
const resourceName = 'tokens';

module.exports = {

Expand Down
130 changes: 65 additions & 65 deletions api/v1/swagger.yaml

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions tests/api/v1/authenticate/SSOConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@ describe('api: login ssoconfig', () => {
if (ssoconfig) {
api.get(loginPath)
.expect(constants.httpStatus.OK)
.expect((res) => {
expect(res.text).to.contain('SSO Login');
expect(res.text).to.not.contain('Sign Up');
})
.end((err/* , res*/) => {
.end((err, res) => {
if (err) {
return done(err);
}

expect(res.text).to.contain('SSO Login');
expect(res.text).to.not.contain('Sign Up');

done();
});
}
})
.then(() => done())
.catch((err) => done(err));
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

/**
* tests/api/v1/token/utils.js
* tests/api/v1/tokens/utils.js
*/

const tu = require('../../../testUtils');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

/**
* tests/tokenReq/api/token/createtoken.js
* tests/tokenReq/api/tokens/createtoken.js
*/

const expect = require('chai').expect;
Expand All @@ -16,7 +16,7 @@ const api = supertest(require('../../../../index').app);
const constants = require('../../../../api/v1/constants');
const u = require('./utils');
const registerPath = '/v1/register';
const tokenPath = '/v1/token';
const tokenPath = '/v1/tokens';

describe('api: createToken', () => {
let defaultToken;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

/**
* tests/tokenReq/api/token/utils.js
* tests/tokenReq/api/tokens/utils.js
*/

const tu = require('../../../testUtils');
Expand Down

0 comments on commit 1c26cb3

Please sign in to comment.