Commit c382fc37 authored by Girish Ramakrishnan's avatar Girish Ramakrishnan

Set the resetTokenCreationTime in invitation links

parent 2544acdd
......@@ -584,13 +584,13 @@ function createInvite(user, callback) {
if (user.source) return callback(new BoxError(BoxError.CONFLICT, 'User is from an external directory'));
let resetToken = hat(256);
user.resetToken = resetToken;
const resetToken = hat(256), resetTokenCreationTime = new Date();
userdb.update(user.id, { resetToken }, function (error) {
userdb.update(user.id, { resetToken, resetTokenCreationTime }, function (error) {
if (error) return callback(error);
callback(null, { resetToken: user.resetToken, inviteLink: inviteLink(user) });
user.resetToken = resetToken;
callback(null, { resetToken, inviteLink: inviteLink(user) });
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment