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') {
const protocol = req.secure || req.get('x-forwarded-proto') === 'https' ? 'https' : 'http'
const host = req.get('host')
// TODO: ABS does currently not support subfolders for installation
// If we want to support it we need to include a config for the serverurl
postLogoutRedirectUri = `${protocol}://${host}${global.RouterBasePath}/login`
const hostUrl = new URL(`${protocol}://${host}`)
const subfolder = global.ServerSettings.authOpenIDSubfolderForRedirectURLs || ''
postLogoutRedirectUri = new URL(`${subfolder}/login`, hostUrl).toString()
}
// 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