Add ability to prevent OIDC redirect (#6544)

* Add ability to prevent OIDC redirect

* Fix Typing on optional boolean

* Fix lint

* Fix lint

* Rename var from PREVENT to DISABLE

---------

Co-authored-by: Tom Moor <tom@getoutline.com>
This commit is contained in:
Shuttleu
2024-02-16 17:48:40 +00:00
committed by GitHub
parent 2b0a8d1f7c
commit 0219885548
5 changed files with 41 additions and 2 deletions

View File

@@ -229,7 +229,11 @@ function Login({ children }: Props) {
}
// If there is only one provider and it's OIDC, redirect immediately.
if (config.providers.length === 1 && config.providers[0].id === "oidc") {
if (
config.providers.length === 1 &&
config.providers[0].id === "oidc" &&
!env.OIDC_DISABLE_REDIRECT
) {
window.location.href = getRedirectUrl(config.providers[0].authUrl);
return null;
}