Skip to content

Commit

Permalink
fix: forgotten password - extend reset token expire time (#1556)
Browse files Browse the repository at this point in the history
* forgot password - set password expire after 12h

* set expire to 8h and add notification message in the email
  • Loading branch information
adrianboros authored Sep 6, 2024
1 parent 1620a87 commit fe4476b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/wallet/backend/src/email/templates/forgotPassword.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ export const getForgotPasswordEmailTemplate = (url: string): string => {
</a>
</td>
</tr>
<tr>
<td>
<p style="font-size:12px;line-height:24px;margin:10px 0 0px 0;color:#000">Password reset link will expire in 8 hours.</p>
</td>
</tr>
<tr>
<td>
<p style="font-size:12px;line-height:24px;margin:16px 0 2px 0;color:#000">If you didn&#x27;t request this email, there&#x27;s nothing to worry about, you can safely ignore it.</p>
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet/backend/src/user/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class UserService implements IUserService {

const resetToken = getRandomToken()
const passwordResetToken = hashToken(resetToken)
const passwordResetExpiresAt = new Date(Date.now() + 10 * 60 * 1000)
const passwordResetExpiresAt = new Date(Date.now() + 8 * 3600 * 1000)

await User.query()
.findById(user.id)
Expand Down

0 comments on commit fe4476b

Please sign in to comment.