mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 02:05:22 -05:00
Added missing email field when registering user token (#2130)
GitOrigin-RevId: f7aaeae1f82e0188c838d7d1d975a81664950f78
This commit is contained in:
parent
7c68947100
commit
dc6e4b3a12
2 changed files with 3 additions and 2 deletions
|
@ -122,7 +122,7 @@ const UserRegistrationHandler = {
|
|||
const ONE_WEEK = 7 * 24 * 60 * 60 // seconds
|
||||
OneTimeTokenHandler.getNewToken(
|
||||
'password',
|
||||
user._id,
|
||||
{ user_id: user._id.toString(), email },
|
||||
{ expiresIn: ONE_WEEK },
|
||||
(err, token) => {
|
||||
if (err != null) {
|
||||
|
|
|
@ -282,8 +282,9 @@ describe('UserRegistrationHandler', function() {
|
|||
})
|
||||
|
||||
it('should generate a new password reset token', function() {
|
||||
const data = { user_id: this.user._id.toString(), email: this.email }
|
||||
return this.OneTimeTokenHandler.getNewToken
|
||||
.calledWith('password', this.user_id, { expiresIn: 7 * 24 * 60 * 60 })
|
||||
.calledWith('password', data, { expiresIn: 7 * 24 * 60 * 60 })
|
||||
.should.equal(true)
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue