Skip to content

Commit

Permalink
Merge 074b40c into 84322c8
Browse files Browse the repository at this point in the history
  • Loading branch information
Cavdy committed Aug 20, 2019
2 parents 84322c8 + 074b40c commit c7554f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/controllers/authController.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class AuthController {
const values = { userName, email, password: hashedpassword, role };
const result = await User.create(values);
const { id, isVerified } = result;
const token = await generateToken({ id, email, isVerified, role });
const token = await generateToken({ id, userName, email, isVerified, role });

const url = `https://ah-nyati-frontend.herokuapp.com/dashboard?verifyToken=${token}`;
const message = template(userName, url);
Expand Down Expand Up @@ -117,8 +117,8 @@ class AuthController {
const result = await User.findOne({ where: { email } });
if (result) {
if (bcrypt.compareSync(password, result.password)) {
const { id, isVerified, role } = result;
const token = await generateToken({ id, email, isVerified, role });
const { id, userName, isVerified, role } = result;
const token = await generateToken({ id, userName, email, isVerified, role });

const user = {
id: result.id,
Expand Down
1 change: 0 additions & 1 deletion src/routes/userRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const { superAdmin } = roles;
const { idParamValidator, roleValidator } = userValidator;

router.get('/profiles/:userName',
verify,
UserController.getUserProfile);

router.get('/profiles/',
Expand Down

0 comments on commit c7554f8

Please sign in to comment.