feat(server): add ExtAuth logout URL configuration (#5074)

* feat(server): add ExtAuth logout URL configuration (#4467)

When external authentication (reverse proxy auth) is active, the Logout
button is hidden because authentication is managed externally. Many
external auth services (Authelia, Authentik, Keycloak) provide a logout
URL that can terminate the session.

Add `ExtAuth.LogoutURL` config option that, when set, shows the Logout
button in the UI and redirects the user to the external auth provider's
logout endpoint instead of the Navidrome login page.

* feat(server): add validation for ExtAuth logout URL configuration

* feat(server): refactor ExtAuth logout URL validation to a reusable function

* fix(configuration): rename URL validation functions for consistency

Signed-off-by: Deluan <deluan@navidrome.org>

* fix(configuration): rename URL validation functions for consistency

Signed-off-by: Deluan <deluan@navidrome.org>

---------

Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Deluan Quintão
2026-02-23 20:28:38 -05:00
committed by GitHub
parent d1c5e6a2f2
commit 2bb13e5ff1
7 changed files with 81 additions and 1 deletions
+4
View File
@@ -66,6 +66,10 @@ const authProvider = {
logout: () => {
removeItems()
if (config.extAuthLogoutURL) {
window.location.href = config.extAuthLogoutURL
return Promise.resolve(false)
}
return Promise.resolve()
},
+1 -1
View File
@@ -122,7 +122,7 @@ const UserMenu = (props) => {
})
: null,
)}
{!config.auth && logout}
{(!config.auth || !!config.extAuthLogoutURL) && logout}
</MenuList>
</Popover>
</div>