diff options
author | Chocobozzz <me@florianbigard.com> | 2019-04-11 11:33:44 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-04-11 13:45:39 +0200 |
commit | 6dd9de95dfa39bd5c1faed00d1dbd52cd112bae0 (patch) | |
tree | b47de7efb8c6c611c63a15a971c6125a278f547a /server/controllers/api/users/index.ts | |
parent | 2c3abc4fa796555eb7d25f416c4f41ab3e3ad8ca (diff) | |
download | PeerTube-6dd9de95dfa39bd5c1faed00d1dbd52cd112bae0.tar.gz PeerTube-6dd9de95dfa39bd5c1faed00d1dbd52cd112bae0.tar.zst PeerTube-6dd9de95dfa39bd5c1faed00d1dbd52cd112bae0.zip |
Move config in its own file
Diffstat (limited to 'server/controllers/api/users/index.ts')
-rw-r--r-- | server/controllers/api/users/index.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/server/controllers/api/users/index.ts b/server/controllers/api/users/index.ts index 2117bdfeb..a049e23e4 100644 --- a/server/controllers/api/users/index.ts +++ b/server/controllers/api/users/index.ts | |||
@@ -3,7 +3,7 @@ import * as RateLimit from 'express-rate-limit' | |||
3 | import { UserCreate, UserRight, UserRole, UserUpdate } from '../../../../shared' | 3 | import { UserCreate, UserRight, UserRole, UserUpdate } from '../../../../shared' |
4 | import { logger } from '../../../helpers/logger' | 4 | import { logger } from '../../../helpers/logger' |
5 | import { getFormattedObjects } from '../../../helpers/utils' | 5 | import { getFormattedObjects } from '../../../helpers/utils' |
6 | import { CONFIG, RATES_LIMIT, sequelizeTypescript } from '../../../initializers' | 6 | import { RATES_LIMIT, sequelizeTypescript, WEBSERVER } from '../../../initializers' |
7 | import { Emailer } from '../../../lib/emailer' | 7 | import { Emailer } from '../../../lib/emailer' |
8 | import { Redis } from '../../../lib/redis' | 8 | import { Redis } from '../../../lib/redis' |
9 | import { createUserAccountAndChannelAndPlaylist } from '../../../lib/user' | 9 | import { createUserAccountAndChannelAndPlaylist } from '../../../lib/user' |
@@ -43,6 +43,7 @@ import { myVideosHistoryRouter } from './my-history' | |||
43 | import { myNotificationsRouter } from './my-notifications' | 43 | import { myNotificationsRouter } from './my-notifications' |
44 | import { Notifier } from '../../../lib/notifier' | 44 | import { Notifier } from '../../../lib/notifier' |
45 | import { mySubscriptionsRouter } from './my-subscriptions' | 45 | import { mySubscriptionsRouter } from './my-subscriptions' |
46 | import { CONFIG } from '../../../initializers/config' | ||
46 | 47 | ||
47 | const auditLogger = auditLoggerFactory('users') | 48 | const auditLogger = auditLoggerFactory('users') |
48 | 49 | ||
@@ -293,7 +294,7 @@ async function askResetUserPassword (req: express.Request, res: express.Response | |||
293 | const user = res.locals.user | 294 | const user = res.locals.user |
294 | 295 | ||
295 | const verificationString = await Redis.Instance.setResetPasswordVerificationString(user.id) | 296 | const verificationString = await Redis.Instance.setResetPasswordVerificationString(user.id) |
296 | const url = CONFIG.WEBSERVER.URL + '/reset-password?userId=' + user.id + '&verificationString=' + verificationString | 297 | const url = WEBSERVER.URL + '/reset-password?userId=' + user.id + '&verificationString=' + verificationString |
297 | await Emailer.Instance.addPasswordResetEmailJob(user.email, url) | 298 | await Emailer.Instance.addPasswordResetEmailJob(user.email, url) |
298 | 299 | ||
299 | return res.status(204).end() | 300 | return res.status(204).end() |
@@ -310,7 +311,7 @@ async function resetUserPassword (req: express.Request, res: express.Response) { | |||
310 | 311 | ||
311 | async function sendVerifyUserEmail (user: UserModel) { | 312 | async function sendVerifyUserEmail (user: UserModel) { |
312 | const verificationString = await Redis.Instance.setVerifyEmailVerificationString(user.id) | 313 | const verificationString = await Redis.Instance.setVerifyEmailVerificationString(user.id) |
313 | const url = CONFIG.WEBSERVER.URL + '/verify-account/email?userId=' + user.id + '&verificationString=' + verificationString | 314 | const url = WEBSERVER.URL + '/verify-account/email?userId=' + user.id + '&verificationString=' + verificationString |
314 | await Emailer.Instance.addVerifyEmailJob(user.email, url) | 315 | await Emailer.Instance.addVerifyEmailJob(user.email, url) |
315 | return | 316 | return |
316 | } | 317 | } |