Skip to content

Commit

Permalink
feat(recoverPassword): remove reset url from env and update in test (#30
Browse files Browse the repository at this point in the history
)
  • Loading branch information
iamuchejude authored and aknwosu committed Sep 6, 2018
1 parent 430df03 commit 5e083f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ TWITTER_APP_SECRET=
GOOGLE_APP_ID=
GOOGLE_APP_SECRET=

RESET_URL=

SENDGRID_API_KEY=
AUTHOR_PASSWORD=
AUTHOR_EMAIL=
8 changes: 4 additions & 4 deletions server/tests/controllers/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const correctDetails = { email: 'emekag@gmail.com', password: 'emeka' };
const incorrectDetails = { email: 'emekag@gmail.com', password: 'wrongpassword' };
const emptyEmailField = { email: '', password: 'emeka' };
const emptyPasswordField = { email: 'emekag@gmail.com', password: '' };
const token = jwt.sign({ user: { email: user.email }, links: { reset: process.env.RESET_URL } }, process.env.SECRET, { expiresIn: '2h' });
const token = jwt.sign({ user: { email: user.email }, links: { reset: 'https://thor-ah.com' } }, process.env.SECRET, { expiresIn: '2h' });
const wrongToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImlhbXVjaGVqdWRlQGdtYWlsLmNvbSIsImlhdCI6MTUzNTczMTgyNSwiZXhwIjoxNTM1NzM5MDI1fQ.BBwKljkzNFTKVuCE4VRHTv8GF4Q6uuA6_KZ8MMLdvR4';

describe('Users Controllers', () => {
Expand Down Expand Up @@ -157,7 +157,7 @@ describe('Users Controllers', () => {
email: user.email,
},
links: {
reset: process.env.RESET_URL,
reset: 'https://thor-ah.com',
}
})
.end((err, res) => {
Expand All @@ -175,7 +175,7 @@ describe('Users Controllers', () => {
email: '',
},
links: {
reset: process.env.RESET_URL,
reset: 'https://thor-ah.com',
}
})
.end((err, res) => {
Expand All @@ -193,7 +193,7 @@ describe('Users Controllers', () => {
email: 'emailnot@registered.com',
},
links: {
reset: process.env.RESET_URL,
reset: 'https://thor-ah.com',
}
})
.end((err, res) => {
Expand Down

0 comments on commit 5e083f0

Please sign in to comment.