mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
Registration page: the initial commit
This commit is contained in:
@@ -11,6 +11,7 @@ import EmailHelper from '../Helpers/EmailHelper.mjs'
|
||||
import EditorRealTimeController from '../Editor/EditorRealTimeController.mjs'
|
||||
import AnalyticsManager from '../Analytics/AnalyticsManager.mjs'
|
||||
import SessionManager from '../Authentication/SessionManager.mjs'
|
||||
import Features from '../../infrastructure/Features.mjs'
|
||||
import { RateLimiter } from '../../infrastructure/RateLimiter.mjs'
|
||||
import { z, zz, parseReq } from '../../infrastructure/Validation.mjs'
|
||||
import { expressify } from '@overleaf/promise-utils'
|
||||
@@ -335,7 +336,11 @@ async function viewInvite(req, res) {
|
||||
user_first_name: owner.first_name,
|
||||
}
|
||||
AuthenticationController.setRedirectInSession(req)
|
||||
return res.redirect('/register')
|
||||
if (Features.hasFeature('registration-page')) {
|
||||
return res.redirect('/register')
|
||||
} else {
|
||||
return res.redirect('/login')
|
||||
}
|
||||
}
|
||||
|
||||
// cleanup if set for register page
|
||||
@@ -375,7 +380,11 @@ async function viewSharingLink(req, res) {
|
||||
const currentUser = SessionManager.getSessionUser(req.session)
|
||||
if (!currentUser) {
|
||||
AuthenticationController.setRedirectInSession(req)
|
||||
return res.redirect('/register')
|
||||
if (Features.hasFeature('registration-page')) {
|
||||
return res.redirect('/register')
|
||||
} else {
|
||||
return res.redirect('/login')
|
||||
}
|
||||
}
|
||||
|
||||
// cleanup if set for register page
|
||||
|
||||
@@ -34,6 +34,7 @@ const Features = {
|
||||
return (
|
||||
(Boolean(Settings.ldap) && Boolean(Settings.ldap.enable)) ||
|
||||
(Boolean(Settings.saml) && Boolean(Settings.saml.enable)) ||
|
||||
(Boolean(Settings.oidc) && Boolean(Settings.oidc.enable)) ||
|
||||
Boolean(Settings.overleaf)
|
||||
)
|
||||
},
|
||||
@@ -51,10 +52,7 @@ const Features = {
|
||||
case 'homepage':
|
||||
return Boolean(Settings.enableHomepage)
|
||||
case 'registration-page':
|
||||
return (
|
||||
!Features.externalAuthenticationSystemUsed() ||
|
||||
Boolean(Settings.overleaf) || Settings.oidc?.allowedOIDCEmailDomains
|
||||
)
|
||||
return Boolean(Settings.enableRegistrationPage)
|
||||
case 'registration':
|
||||
return Boolean(Settings.overleaf)
|
||||
case 'chat':
|
||||
|
||||
Reference in New Issue
Block a user