Fix cloud authorization when token was expired/invalid (#4032)
* Fix cloud auth if token was expired * Fix cloud auth if token was expired
This commit is contained in:
parent
d38abfb16b
commit
63f2ef0a18
1 changed files with 2 additions and 12 deletions
|
@ -1,5 +1,4 @@
|
|||
// @ts-strict-ignore
|
||||
import { getAppMountUri } from "@dashboard/config";
|
||||
import { getAppMountUriForRedirect } from "@dashboard/utils/urls";
|
||||
import { useEffect } from "react";
|
||||
import urlJoin from "url-join";
|
||||
|
@ -40,17 +39,8 @@ export const useAuthRedirection = () => {
|
|||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (!shouldRedirect) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (authenticated || authenticating) {
|
||||
window.location.href = getAppMountUri();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!authenticated && !authenticating) {
|
||||
handleAuthentication();
|
||||
if (shouldRedirect && !authenticated && !authenticating) {
|
||||
handleAuthentication()
|
||||
}
|
||||
}, [shouldRedirect, authenticated, authenticating]);
|
||||
|
||||
|
|
Loading…
Reference in a new issue