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.
|
// fetch the full-scoped (with all available tenants) token.
|
||||||
if (await trySafe(getAccessToken(indicator))) {
|
if (await trySafe(getAccessToken(indicator))) {
|
||||||
setIsSettle(true);
|
setIsSettle(true);
|
||||||
|
navigate(toTenantId);
|
||||||
} else {
|
} else {
|
||||||
void signIn(new URL(href, window.location.origin).toString());
|
void signIn(new URL(href, window.location.origin).toString());
|
||||||
}
|
}
|
||||||
|
@ -33,7 +34,7 @@ function Redirect({ tenants, toTenantId }: Props) {
|
||||||
if (tenant) {
|
if (tenant) {
|
||||||
void validate(tenant.indicator);
|
void validate(tenant.indicator);
|
||||||
}
|
}
|
||||||
}, [getAccessToken, href, setIsSettle, signIn, tenant]);
|
}, [getAccessToken, href, navigate, setIsSettle, signIn, tenant, toTenantId]);
|
||||||
|
|
||||||
if (!tenant) {
|
if (!tenant) {
|
||||||
/** Fallback to another available tenant instead of showing `Forbidden`. */
|
/** Fallback to another available tenant instead of showing `Forbidden`. */
|
||||||
|
|
Loading…
Reference in a new issue