mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-28 04:03:48 +00: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
|
const ONE_WEEK = 7 * 24 * 60 * 60 // seconds
|
||||||
OneTimeTokenHandler.getNewToken(
|
OneTimeTokenHandler.getNewToken(
|
||||||
'password',
|
'password',
|
||||||
user._id,
|
{ user_id: user._id.toString(), email },
|
||||||
{ expiresIn: ONE_WEEK },
|
{ expiresIn: ONE_WEEK },
|
||||||
(err, token) => {
|
(err, token) => {
|
||||||
if (err != null) {
|
if (err != null) {
|
||||||
|
|
|
@ -282,8 +282,9 @@ describe('UserRegistrationHandler', function() {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should generate a new password reset token', 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
|
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)
|
.should.equal(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue