refactor: unify app navigation to default to HomeScreen and remove role-based routing redirection

This commit is contained in:
pradeepkumar
2026-05-06 14:59:38 +05:30
parent 6e77dc9d27
commit 019df719fc
4 changed files with 11 additions and 27 deletions

View File

@@ -65,10 +65,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen> {
// Navigate on auth state changes
ref.listen<AuthState>(authProvider, (previous, next) {
if (next.status == AuthStatus.authenticated) {
// Agents land on /profile (defaults to "Edit Profile" tab —
// their dashboard/home view). Users land on /home.
final isAgent = next.user?.role == 'AGENT';
context.go(isAgent ? '/profile' : '/home');
context.go('/home');
}
// Navigate to 2FA verification screen
if (next.requiresTwoFactor && next.tempToken != null) {