Fix OpenID logout redirect URI for subfolder deployments

This commit is contained in:
Jonathan Baldie 2026-05-01 20:10:27 +01:00
parent 47457ee1e7
commit 0331ca1441

View file

@ -396,9 +396,9 @@ class OidcAuthStrategy {
if (authMethod === 'openid') { if (authMethod === 'openid') {
const protocol = req.secure || req.get('x-forwarded-proto') === 'https' ? 'https' : 'http' const protocol = req.secure || req.get('x-forwarded-proto') === 'https' ? 'https' : 'http'
const host = req.get('host') const host = req.get('host')
// TODO: ABS does currently not support subfolders for installation const hostUrl = new URL(`${protocol}://${host}`)
// If we want to support it we need to include a config for the serverurl const subfolder = global.ServerSettings.authOpenIDSubfolderForRedirectURLs || ''
postLogoutRedirectUri = `${protocol}://${host}${global.RouterBasePath}/login` postLogoutRedirectUri = new URL(`${subfolder}/login`, hostUrl).toString()
} }
// else for openid-mobile we keep postLogoutRedirectUri on null // else for openid-mobile we keep postLogoutRedirectUri on null
// nice would be to redirect to the app here, but for example Authentik does not implement // nice would be to redirect to the app here, but for example Authentik does not implement