0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

refactor(console): prioritize onboarding check for route redirect

This commit is contained in:
Gao Sun 2024-05-28 22:01:16 +08:00
parent b10e138f87
commit cd7b54459e
No known key found for this signature in database
GPG key ID: 13EBE123E4773688

View file

@ -23,16 +23,16 @@ export default function Main() {
return <AppLoading />;
}
// If current tenant ID is not set, but the defaultTenantId is available.
if (defaultTenantId) {
return <Redirect toTenantId={defaultTenantId} />;
}
// A new user has just signed up, redirect them to the onboarding flow.
if (isOnboarding) {
return <Navigate to={GlobalRoute.Onboarding} />;
}
// If current tenant ID is not set, but the defaultTenantId is available.
if (defaultTenantId) {
return <Redirect toTenantId={defaultTenantId} />;
}
// If user has pending invitations (onboarding will be skipped), show the invitation list and allow them to quick join.
if (isCloud && data?.length) {
return <InvitationList invitations={data} />;