mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-23 05:52:57 +00:00
If external auth is used, remove /register
items from header nav.
(logic moved from docker-image settings file)
This commit is contained in:
parent
259c589076
commit
7bbbfe20b9
1 changed files with 11 additions and 0 deletions
|
@ -244,6 +244,17 @@ module.exports = (app, webRouter, apiRouter)->
|
|||
for key, value of Settings.nav
|
||||
res.locals.nav[key] = _.clone(Settings.nav[key])
|
||||
res.locals.templates = Settings.templateLinks
|
||||
try
|
||||
externalAuth = res.locals.externalAuthenticationSystemUsed()
|
||||
if externalAuth and res.locals.nav.header?
|
||||
# filter out '/register' link
|
||||
res.locals.nav.header = _.filter(
|
||||
res.locals.nav.header,
|
||||
(h) ->
|
||||
h.url != '/register'
|
||||
)
|
||||
catch error
|
||||
logger.error {error}, "error while trying to filter out '/register' links from header"
|
||||
next()
|
||||
|
||||
webRouter.use (req, res, next) ->
|
||||
|
|
Loading…
Reference in a new issue