fix(auth): always redirect to external openid provider if only one is enabled
continuous-integration/drone/push Build is passing Details

This commit is contained in:
kolaente 2022-11-04 13:08:12 +01:00
parent e49f960aea
commit f967bcb205
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 1 additions and 1 deletions

View File

@ -23,7 +23,7 @@ function redirectToProviderIfNothingElseIsEnabled() {
auth.local.enabled === false &&
auth.openidConnect.enabled &&
auth.openidConnect.providers?.length === 1 &&
window.location.pathname.startsWith('/login') // Kinda hacky, but prevents an endless loop.
(window.location.pathname.startsWith('/login') || window.location.pathname === '/') // Kinda hacky, but prevents an endless loop.
) {
redirectToProvider(auth.openidConnect.providers[0], auth.openidConnect.redirectUrl)
}