diff options
author | Josh Morel <morel.josh@hotmail.com> | 2018-08-31 03:18:19 -0400 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-31 09:18:19 +0200 |
commit | d9eaee3939bf2e93e5d775d32bce77842201faba (patch) | |
tree | c115acb3611986b98f51b3addf29ebe66f63ee7f /server/initializers/constants.ts | |
parent | 04291e1ba44032165388758e993d385a10c1c5a1 (diff) | |
download | PeerTube-d9eaee3939bf2e93e5d775d32bce77842201faba.tar.gz PeerTube-d9eaee3939bf2e93e5d775d32bce77842201faba.tar.zst PeerTube-d9eaee3939bf2e93e5d775d32bce77842201faba.zip |
add user account email verificiation (#977)
* add user account email verificiation
includes server and client code to:
* enable verificationRequired via custom config
* send verification email with registration
* ask for verification email
* verify via email
* prevent login if not verified and required
* conditional client links to ask for new verification email
* allow login for verified=null
these are users created when verification not required
should still be able to login when verification is enabled
* refactor email verifcation pr
* change naming from verified to emailVerified
* change naming from askVerifyEmail to askSendVerifyEmail
* undo unrelated automatic prettier formatting on api/config
* use redirectService for home
* remove redundant success notification on email verified
* revert test.yaml smpt host
Diffstat (limited to 'server/initializers/constants.ts')
-rw-r--r-- | server/initializers/constants.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 2d9a2e670..5d93c6b82 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts | |||
@@ -15,7 +15,7 @@ let config: IConfig = require('config') | |||
15 | 15 | ||
16 | // --------------------------------------------------------------------------- | 16 | // --------------------------------------------------------------------------- |
17 | 17 | ||
18 | const LAST_MIGRATION_VERSION = 260 | 18 | const LAST_MIGRATION_VERSION = 265 |
19 | 19 | ||
20 | // --------------------------------------------------------------------------- | 20 | // --------------------------------------------------------------------------- |
21 | 21 | ||
@@ -204,6 +204,7 @@ const CONFIG = { | |||
204 | SIGNUP: { | 204 | SIGNUP: { |
205 | get ENABLED () { return config.get<boolean>('signup.enabled') }, | 205 | get ENABLED () { return config.get<boolean>('signup.enabled') }, |
206 | get LIMIT () { return config.get<number>('signup.limit') }, | 206 | get LIMIT () { return config.get<number>('signup.limit') }, |
207 | get REQUIRES_EMAIL_VERIFICATION () { return config.get<boolean>('signup.requires_email_verification') }, | ||
207 | FILTERS: { | 208 | FILTERS: { |
208 | CIDR: { | 209 | CIDR: { |
209 | get WHITELIST () { return config.get<string[]>('signup.filters.cidr.whitelist') }, | 210 | get WHITELIST () { return config.get<string[]>('signup.filters.cidr.whitelist') }, |
@@ -500,6 +501,8 @@ const BCRYPT_SALT_SIZE = 10 | |||
500 | 501 | ||
501 | const USER_PASSWORD_RESET_LIFETIME = 60000 * 5 // 5 minutes | 502 | const USER_PASSWORD_RESET_LIFETIME = 60000 * 5 // 5 minutes |
502 | 503 | ||
504 | const USER_EMAIL_VERIFY_LIFETIME = 60000 * 60 // 60 minutes | ||
505 | |||
503 | const NSFW_POLICY_TYPES: { [ id: string]: NSFWPolicyType } = { | 506 | const NSFW_POLICY_TYPES: { [ id: string]: NSFWPolicyType } = { |
504 | DO_NOT_LIST: 'do_not_list', | 507 | DO_NOT_LIST: 'do_not_list', |
505 | BLUR: 'blur', | 508 | BLUR: 'blur', |
@@ -661,6 +664,7 @@ export { | |||
661 | VIDEO_ABUSE_STATES, | 664 | VIDEO_ABUSE_STATES, |
662 | JOB_REQUEST_TIMEOUT, | 665 | JOB_REQUEST_TIMEOUT, |
663 | USER_PASSWORD_RESET_LIFETIME, | 666 | USER_PASSWORD_RESET_LIFETIME, |
667 | USER_EMAIL_VERIFY_LIFETIME, | ||
664 | IMAGE_MIMETYPE_EXT, | 668 | IMAGE_MIMETYPE_EXT, |
665 | SCHEDULER_INTERVALS_MS, | 669 | SCHEDULER_INTERVALS_MS, |
666 | REPEAT_JOBS, | 670 | REPEAT_JOBS, |