},
user: {
videoQuota: -1,
- videoQuotaDaily: -1
+ videoQuotaDaily: -1,
+ resetPasswordLifetime: 5
},
import: {
videos: {
.subscribe(
() => {
const message = this.i18n(
- 'An email with the reset password instructions will be sent to {{email}}. The link will expire within 5 minutes.',
+ `An email with the reset password instructions will be sent to {{email}}. The link will expire within ${this.getResetPasswordLifetime()} minutes.`,
{ email: this.forgotPasswordEmail }
)
this.notifier.success(message)
hideForgotPasswordModal () {
this.openedForgotPasswordModal.close()
}
+
+ getResetPasswordLifetime () {
+ return this.serverService.getConfig().user.resetPasswordLifetime
+ }
}
# -1 == unlimited
video_quota: -1
video_quota_daily: -1
+ password_reset_lifetime: 15 # Minutes before password reset link expiration
# If enabled, the video will be transcoded to mp4 (x264) with "faststart" flag
# In addition, if some resolutions are enabled the mp4 video file will be transcoded to these new resolutions.
# -1 == unlimited
video_quota: -1
video_quota_daily: -1
+ password_reset_lifetime: 5 # Minutes before password reset link expiration
# If enabled, the video will be transcoded to mp4 (x264) with "faststart" flag
# In addition, if some resolutions are enabled the mp4 video file will be transcoded to these new resolutions.
},
user: {
videoQuota: CONFIG.USER.VIDEO_QUOTA,
- videoQuotaDaily: CONFIG.USER.VIDEO_QUOTA_DAILY
+ videoQuotaDaily: CONFIG.USER.VIDEO_QUOTA_DAILY,
+ resetPasswordLifetime: CONFIG.USER.USER_PASSWORD_RESET_LIFETIME
},
trending: {
videos: {
},
USER: {
get VIDEO_QUOTA () { return parseBytes(config.get<number>('user.video_quota')) },
- get VIDEO_QUOTA_DAILY () { return parseBytes(config.get<number>('user.video_quota_daily')) }
+ get VIDEO_QUOTA_DAILY () { return parseBytes(config.get<number>('user.video_quota_daily')) },
+ get USER_PASSWORD_RESET_LIFETIME () { return parseBytes(config.get<number>('user.password_reset_lifetime')) }
},
TRANSCODING: {
get ENABLED () { return config.get<boolean>('transcoding.enabled') },
// Password encryption
const BCRYPT_SALT_SIZE = 10
-const USER_PASSWORD_RESET_LIFETIME = 60000 * 5 // 5 minutes
-
const USER_EMAIL_VERIFY_LIFETIME = 60000 * 60 // 60 minutes
const NSFW_POLICY_TYPES: { [ id: string ]: NSFWPolicyType } = {
VIDEO_ABUSE_STATES,
CACHE,
JOB_REQUEST_TIMEOUT,
- USER_PASSWORD_RESET_LIFETIME,
MEMOIZE_TTL,
USER_EMAIL_VERIFY_LIFETIME,
OVERVIEWS,
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} (the link will expire within 5 minutes)\n\n` +
+ `Please follow this link to reset it: ${resetPasswordUrl} (the link will expire within ${CONFIG.USER.USER_PASSWORD_RESET_LIFETIME} minutes)\n\n` +
`If you are not the person who initiated this request, please ignore this email.\n\n` +
`Cheers,\n` +
`${CONFIG.EMAIL.BODY.SIGNATURE}`
import {
CONTACT_FORM_LIFETIME,
USER_EMAIL_VERIFY_LIFETIME,
- USER_PASSWORD_RESET_LIFETIME,
VIDEO_VIEW_LIFETIME,
WEBSERVER
} from '../initializers/constants'
async setResetPasswordVerificationString (userId: number) {
const generatedString = await generateRandomString(32)
+ const USER_PASSWORD_RESET_LIFETIME = CONFIG.USER.USER_PASSWORD_RESET_LIFETIME * 60000
await this.setValue(this.generateResetPasswordKey(userId), generatedString, USER_PASSWORD_RESET_LIFETIME)
return generatedString
user: {
videoQuota: number
videoQuotaDaily: number
+ resetPasswordLifetime: number
}
trending: {