Fix server crash on logout

This commit is contained in:
advplyr committed 2026-11-11 19:09:00 -06:00
1 parent 2dde0bf1c7
commit 3e0333877b
1 file changed
+9 -1
+9 -1
View File
@@ -393,7 +393,15 @@ class OidcAuthStrategy {
* @returns {string|null}
*/
getEndSessionUrl(req, idToken, authMethod) {
const client = this.getClient()
// Logout trusts the auth_method cookie. getClient() throws when OpenID is not
// configured, and that throw is outside the request promise, so it exits the process.
let client
try {
client = this.getClient()
} catch (error) {
Logger.error(`[OidcAuth] Cannot build end session URL - ${error.message}`)
return null
}
if (client.issuer.end_session_endpoint && client.issuer.end_session_endpoint.length > 0) {
let postLogoutRedirectUri = null