Skip to content

Commit

Permalink
kickoff refactoring for the async/await workshop
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhirsch committed Aug 21, 2019
1 parent 10d03d6 commit f6e7af1
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions packages/fxa-auth-server/lib/routes/password.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,16 @@ module.exports = function(
wrapKb: wrapKb,
emailVerified: emailRecord.emailVerified,
})
.then(keyFetchToken => {
return db
.createPasswordChangeToken({
.then(async keyFetchToken => {
const passwordChangeToken = await db.createPasswordChangeToken(
{
uid: emailRecord.uid,
})
.then(passwordChangeToken => {
return {
keyFetchToken: keyFetchToken,
passwordChangeToken: passwordChangeToken,
};
});
}
);
return {
keyFetchToken: keyFetchToken,
passwordChangeToken: passwordChangeToken,
};
});
});
},
Expand Down

0 comments on commit f6e7af1

Please sign in to comment.