Files
overleaf-cep/services/web/modules/launchpad/app/src/LaunchpadRouter.js
Eric Mc Sween e0d91eaa26 Merge pull request #7906 from overleaf/em-downgrade-logs
Downgrade all INFO logs to DEBUG

GitOrigin-RevId: 05ed582ef0721fcada059f0ad158565f50feca27
2022-05-17 08:05:26 +00:00

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'
)
}
},
}