Add pricing entry flow and platform admin foundations
This commit is contained in:
@@ -17,18 +17,19 @@ final routerProvider = Provider<GoRouter>((ref) {
|
||||
|
||||
return GoRouter(
|
||||
refreshListenable: notifier,
|
||||
initialLocation: routeSignIn,
|
||||
initialLocation: routeWelcome,
|
||||
redirect: (context, state) {
|
||||
final auth = ref.read(authProvider);
|
||||
|
||||
if (auth.isLoading) return null;
|
||||
|
||||
final loc = state.matchedLocation;
|
||||
final onLoginOrRegister = loc == routeSignIn || loc == routeSignUp;
|
||||
final onLoginOrRegister =
|
||||
loc == routeSignIn || loc == routeSignUp || loc == routeWelcome;
|
||||
final onAuthPage = onLoginOrRegister || loc == routeOnboarding;
|
||||
|
||||
if (!auth.isAuthenticated) {
|
||||
return onAuthPage ? null : routeSignIn;
|
||||
return onAuthPage ? null : routeWelcome;
|
||||
}
|
||||
|
||||
// Authenticated but no tenant → onboarding
|
||||
|
||||
Reference in New Issue
Block a user