mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-04 11:28:21 -05:00
e0d91eaa26
Downgrade all INFO logs to DEBUG GitOrigin-RevId: 05ed582ef0721fcada059f0ad158565f50feca27
30 lines
1 KiB
JavaScript
30 lines
1 KiB
JavaScript
const logger = require('@overleaf/logger')
|
|
const UserActivateController = require('./UserActivateController')
|
|
const AuthenticationController = require('../../../../app/src/Features/Authentication/AuthenticationController')
|
|
const AuthorizationMiddleware = require('../../../../app/src/Features/Authorization/AuthorizationMiddleware')
|
|
|
|
module.exports = {
|
|
apply(webRouter) {
|
|
logger.debug({}, 'Init UserActivate router')
|
|
|
|
webRouter.get(
|
|
'/admin/user',
|
|
AuthorizationMiddleware.ensureUserIsSiteAdmin,
|
|
(req, res) => res.redirect('/admin/register')
|
|
)
|
|
|
|
webRouter.get('/user/activate', UserActivateController.activateAccountPage)
|
|
AuthenticationController.addEndpointToLoginWhitelist('/user/activate')
|
|
|
|
webRouter.get(
|
|
'/admin/register',
|
|
AuthorizationMiddleware.ensureUserIsSiteAdmin,
|
|
UserActivateController.registerNewUser
|
|
)
|
|
webRouter.post(
|
|
'/admin/register',
|
|
AuthorizationMiddleware.ensureUserIsSiteAdmin,
|
|
UserActivateController.register
|
|
)
|
|
},
|
|
}
|