Add oauth enable flag

This commit is contained in:
yzx9
2023-11-24 14:41:49 +08:00
parent a30419ea5a
commit b1d9cedddb
6 changed files with 14 additions and 7 deletions

View File

@@ -264,10 +264,12 @@ function initialize(webRouter, privateApiRouter, publicApiRouter) {
}
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
webRouter.get('/oauth/redirect', AuthenticationController.oauth2Redirect)
webRouter.get('/oauth/callback', AuthenticationController.oauth2Callback)
AuthenticationController.addEndpointToLoginWhitelist('/oauth/redirect')
AuthenticationController.addEndpointToLoginWhitelist('/oauth/callback')
if (process.env.OAUTH2_ENABLED === 'true') {
webRouter.get('/oauth/redirect', AuthenticationController.oauth2Redirect)
webRouter.get('/oauth/callback', AuthenticationController.oauth2Callback)
AuthenticationController.addEndpointToLoginWhitelist('/oauth/redirect')
AuthenticationController.addEndpointToLoginWhitelist('/oauth/callback')
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
EditorRouter.apply(webRouter, privateApiRouter)