ActivityPub-federated video streaming platform using P2P directly in your web browser
Feature/password reset link expiration (#2305)
Nassim Bounouasf88ee4a9523b
diff --git a/client/src/app/login/login.component.ts b/client/src/app/login/login.component.tsindex 12c6311077..911b9982fc 100644--- a/client/src/app/login/login.component.ts+++ b/client/src/app/login/login.component.ts@@ -78,7 +78,7 @@ export class LoginComponent extends FormReactive implements OnInit {.subscribe(() => {const message = this.i18n(- 'An email with the reset password instructions will be sent to {{email}}.',+ 'An email with the reset password instructions will be sent to {{email}}. The link will expire within 1 hour.',{ email: this.forgotPasswordEmail })this.notifier.success(message)diff --git a/server/initializers/constants.ts b/server/initializers/constants.tsindex 7e26176536..79fcd0edf5 100644--- a/server/initializers/constants.ts+++ b/server/initializers/constants.ts@@ -486,7 +486,7 @@ let PRIVATE_RSA_KEY_SIZE = 2048// Password encryptionconst BCRYPT_SALT_SIZE = 10-const USER_PASSWORD_RESET_LIFETIME = 60000 * 5 // 5 minutes+const USER_PASSWORD_RESET_LIFETIME = 60000 * 60 // 60 minutesconst USER_EMAIL_VERIFY_LIFETIME = 60000 * 60 // 60 minutesdiff --git a/server/lib/emailer.ts b/server/lib/emailer.tsindex 523b11d0dc..7484524a45 100644--- a/server/lib/emailer.ts+++ b/server/lib/emailer.ts@@ -369,7 +369,7 @@ class Emailer {addPasswordResetEmailJob (to: string, resetPasswordUrl: string) {const text = `Hi dear user,\n\n` +`A reset password procedure for your account ${to} has been requested on ${WEBSERVER.HOST} ` +- `Please follow this link to reset it: ${resetPasswordUrl}\n\n` ++ `Please follow this link to reset it: ${resetPasswordUrl} (the link will expire within 1 hour)\n\n` +`If you are not the person who initiated this request, please ignore this email.\n\n` +`Cheers,\n` +`${CONFIG.EMAIL.BODY.SIGNATURE}`