mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-25 10:10:08 +02:00
Downgrade all INFO logs to DEBUG GitOrigin-RevId: 05ed582ef0721fcada059f0ad158565f50feca27
54 lines
1.8 KiB
JavaScript
54 lines
1.8 KiB
JavaScript
/* eslint-disable
|
|
max-len,
|
|
*/
|
|
// TODO: This file was created by bulk-decaffeinate.
|
|
// Fix any style issues and re-enable lint.
|
|
/*
|
|
* decaffeinate suggestions:
|
|
* DS102: Remove unnecessary code created because of implicit returns
|
|
* DS207: Consider shorter variations of null checks
|
|
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
|
*/
|
|
const logger = require('@overleaf/logger')
|
|
const LaunchpadController = require('./LaunchpadController')
|
|
const AuthenticationController = require('../../../../app/src/Features/Authentication/AuthenticationController')
|
|
const AuthorizationMiddleware = require('../../../../app/src/Features/Authorization/AuthorizationMiddleware')
|
|
|
|
module.exports = {
|
|
apply(webRouter) {
|
|
logger.debug({}, 'Init launchpad router')
|
|
|
|
webRouter.get('/launchpad', LaunchpadController.launchpadPage)
|
|
webRouter.post(
|
|
'/launchpad/register_admin',
|
|
LaunchpadController.registerAdmin
|
|
)
|
|
webRouter.post(
|
|
'/launchpad/register_ldap_admin',
|
|
LaunchpadController.registerExternalAuthAdmin('ldap')
|
|
)
|
|
webRouter.post(
|
|
'/launchpad/register_saml_admin',
|
|
LaunchpadController.registerExternalAuthAdmin('saml')
|
|
)
|
|
webRouter.post(
|
|
'/launchpad/send_test_email',
|
|
AuthorizationMiddleware.ensureUserIsSiteAdmin,
|
|
LaunchpadController.sendTestEmail
|
|
)
|
|
|
|
if (AuthenticationController.addEndpointToLoginWhitelist != null) {
|
|
AuthenticationController.addEndpointToLoginWhitelist('/launchpad')
|
|
AuthenticationController.addEndpointToLoginWhitelist(
|
|
'/launchpad/register_admin'
|
|
)
|
|
AuthenticationController.addEndpointToLoginWhitelist(
|
|
'/launchpad/register_ldap_admin'
|
|
)
|
|
return AuthenticationController.addEndpointToLoginWhitelist(
|
|
'/launchpad/register_saml_admin'
|
|
)
|
|
}
|
|
},
|
|
}
|