Skip to content

Commit

Permalink
moved jwt utils to util folder
Browse files Browse the repository at this point in the history
  • Loading branch information
pallavi2209 committed Nov 16, 2016
1 parent 4148fbb commit 53fa41e
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion api/v1/controllers/authenticate.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const configuredPassport = require('../../../index').passportModule;
const httpStatus = require('../constants').httpStatus;
const u = require('../helpers/verbs/utils');
const apiErrors = require('../apiErrors');
const jwtUtil = require('../helpers/jwtUtil');
const jwtUtil = require('../../../utils/jwtUtil');

const resourceName = 'authenticate';

Expand Down
2 changes: 1 addition & 1 deletion api/v1/controllers/globalconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const doGet = require('../helpers/verbs/doGet');
const doFind = require('../helpers/verbs/doFind');
const apiErrors = require('../apiErrors');
const u = require('../helpers/verbs/utils');
const jwtUtil = require('../helpers/jwtUtil');
const jwtUtil = require('../../../utils/jwtUtil');

function isAdmin(req) {
return new Promise((resolve, reject) => {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/controllers/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const configuredPassport = require('../../../index').passportModule;
const httpStatus = require('../constants').httpStatus;
const u = require('../helpers/verbs/utils');
const helper = require('../helpers/nouns/users');
const jwtUtil = require('../helpers/jwtUtil');
const jwtUtil = require('../../../utils/jwtUtil');

const resourceName = 'register';

Expand Down
2 changes: 1 addition & 1 deletion api/v1/controllers/token.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const configuredPassport = require('../../../index').passportModule;
const httpStatus = require('../constants').httpStatus;
const u = require('../helpers/verbs/utils');
const apiErrors = require('../apiErrors');
const jwtUtil = require('../helpers/jwtUtil');
const jwtUtil = require('../../../utils/jwtUtil');

const resourceName = 'token';

Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function start() { // eslint-disable-line max-statements
require('./config/passportconfig')(passportModule);

// middleware for checking api token
const jwtUtil = require('./api/v1/helpers/jwtUtil');
const jwtUtil = require('./utils/jwtUtil');

// set up httpServer params
const listening = 'Listening on port';
Expand Down
2 changes: 1 addition & 1 deletion tests/db/model/token/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const Profile = tu.db.Profile;
const User = tu.db.User;
const Token = tu.db.Token;
const pfx = '___';
const jwtUtil = require('../../../../api/v1/helpers/jwtUtil');
const jwtUtil = require('../../../../utils/jwtUtil');

describe('db: Token: create', () => {
let userObj = {};
Expand Down
2 changes: 1 addition & 1 deletion tests/db/model/token/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const tu = require('../../../testUtils');

const testStartTime = new Date();
const pfx = '___';
const jwtUtil = require('../../../../api/v1/helpers/jwtUtil');
const jwtUtil = require('../../../../utils/jwtUtil');
const tokenName = 'testTokenName';

module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion tests/testUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
'use strict';

var pfx = '___';
const jwtUtil = require('../api/v1/helpers/jwtUtil');
const jwtUtil = require('../utils/jwtUtil');
const db = require('../db');
const testStartTime = new Date();

Expand Down
10 changes: 5 additions & 5 deletions api/v1/helpers/jwtUtil.js → utils/jwtUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
*/

/**
* api/v1/helpers/jwt.js
* utils/jwtUtil.js
*/
'use strict'; // eslint-disable-line strict

const jwt = require('jsonwebtoken');
const u = require('./verbs/utils');
const apiErrors = require('../apiErrors');
const conf = require('../../../config');
const u = require('../api/v1/helpers/verbs/utils');
const apiErrors = require('../api/v1/apiErrors');
const conf = require('../config');
const env = conf.environment[conf.nodeEnv];
const User = require('../../../db/index').User;
const User = require('../db/index').User;

/**
* create and handle Invalid Token error
Expand Down
2 changes: 1 addition & 1 deletion view/loadView.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const User = require('../db/index').User;
const Profile = require('../db/index').Profile;
const SamlStrategy = require('passport-saml').Strategy;
const viewConfig = require('../viewConfig');
const jwtUtil = require('../api/v1/helpers/jwtUtil');
const jwtUtil = require('../utils/jwtUtil');
const NOT_FOUND = 404;
const url = require('url');

Expand Down

0 comments on commit 53fa41e

Please sign in to comment.