mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
fix(console): tenant with access token should be redirected (#4056)
This commit is contained in:
parent
013022d24f
commit
b877309f99
1 changed files with 2 additions and 1 deletions
|
@ -25,6 +25,7 @@ function Redirect({ tenants, toTenantId }: Props) {
|
|||
// fetch the full-scoped (with all available tenants) token.
|
||||
if (await trySafe(getAccessToken(indicator))) {
|
||||
setIsSettle(true);
|
||||
navigate(toTenantId);
|
||||
} else {
|
||||
void signIn(new URL(href, window.location.origin).toString());
|
||||
}
|
||||
|
@ -33,7 +34,7 @@ function Redirect({ tenants, toTenantId }: Props) {
|
|||
if (tenant) {
|
||||
void validate(tenant.indicator);
|
||||
}
|
||||
}, [getAccessToken, href, setIsSettle, signIn, tenant]);
|
||||
}, [getAccessToken, href, navigate, setIsSettle, signIn, tenant, toTenantId]);
|
||||
|
||||
if (!tenant) {
|
||||
/** Fallback to another available tenant instead of showing `Forbidden`. */
|
||||
|
|
Loading…
Reference in a new issue