mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 02:09:37 +02:00
Creating a user with an empty password will send an email to let him set his password (#2479)
* Creating a user with an empty password will send an email to let him set his password * Consideration of Chocobozzz's comments * Tips for optional password * API documentation * Fix circular imports * Tests
This commit is contained in:
parent
c5621bd23b
commit
45f1bd72a0
14 changed files with 201 additions and 18 deletions
|
@ -6,6 +6,7 @@ import {
|
|||
CONTACT_FORM_LIFETIME,
|
||||
USER_EMAIL_VERIFY_LIFETIME,
|
||||
USER_PASSWORD_RESET_LIFETIME,
|
||||
USER_PASSWORD_CREATE_LIFETIME,
|
||||
VIDEO_VIEW_LIFETIME,
|
||||
WEBSERVER
|
||||
} from '../initializers/constants'
|
||||
|
@ -74,6 +75,14 @@ class Redis {
|
|||
return generatedString
|
||||
}
|
||||
|
||||
async setCreatePasswordVerificationString (userId: number) {
|
||||
const generatedString = await generateRandomString(32)
|
||||
|
||||
await this.setValue(this.generateResetPasswordKey(userId), generatedString, USER_PASSWORD_CREATE_LIFETIME)
|
||||
|
||||
return generatedString
|
||||
}
|
||||
|
||||
async getResetPasswordLink (userId: number) {
|
||||
return this.getValue(this.generateResetPasswordKey(userId))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue