Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Commit

Permalink
Merge pull request #1384 from mozilla/phil/issue-1378
Browse files Browse the repository at this point in the history
Remove unused method db.createAccountResetToken
  • Loading branch information
seanmonstar authored Aug 1, 2016
2 parents de3acdc + 7659b58 commit b6f2ba8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 29 deletions.
26 changes: 0 additions & 26 deletions lib/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,32 +141,6 @@ module.exports = function (
)
}

DB.prototype.createAccountResetToken = function (token /* authToken|passwordForgotToken */) {
log.trace({ op: 'DB.createAccountResetToken', uid: token && token.uid })
return AccountResetToken.create(token)
.then(
function (accountResetToken) {
return this.pool.put(
'/accountResetToken/' + accountResetToken.id,
unbuffer(
{
tokenId: accountResetToken.tokenId,
data: accountResetToken.data,
uid: accountResetToken.uid,
createdAt: accountResetToken.createdAt
},
'inplace'
)
)
.then(
function () {
return accountResetToken
}
)
}.bind(this)
)
}

DB.prototype.createPasswordForgotToken = function (emailRecord) {
log.trace({ op: 'DB.createPasswordForgotToken', uid: emailRecord && emailRecord.uid })
return PasswordForgotToken.create(emailRecord)
Expand Down
1 change: 0 additions & 1 deletion test/local/account_routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ test('/recovery_email/status', function (t) {
t.test('sign-in confirmation enabled', function (t) {
t.plan(2)
config.signinConfirmation.enabled = true
config.signinConfirmation.enabled = 1
var mockRequest = mocks.mockRequest({
credentials: {
uid: uuid.v4('binary').toString('hex'),
Expand Down
4 changes: 2 additions & 2 deletions test/remote/db_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ test(
var tokenId
return db.emailRecord(ACCOUNT.email)
.then(function(emailRecord) {
return db.createAccountResetToken(emailRecord)
return db.forgotPasswordVerified(emailRecord)
})
.then(function(accountResetToken) {
t.deepEqual(accountResetToken.uid, ACCOUNT.uid, 'account reset token uid should be the same as the account.uid')
Expand Down Expand Up @@ -519,7 +519,7 @@ test(
return db.createSessionToken(emailRecord, 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:41.0) Gecko/20100101 Firefox/41.0')
})
.then(function(sessionToken) {
return db.createAccountResetToken(sessionToken)
return db.forgotPasswordVerified(sessionToken)
})
.then(function(accountResetToken) {
return db.resetAccount(accountResetToken, ACCOUNT)
Expand Down

0 comments on commit b6f2ba8

Please sign in to comment.