feat: route agents to the profile screen instead of home upon authentication

This commit is contained in:
pradeepkumar
2026-05-06 16:41:08 +05:30
parent 0be0da7c57
commit 91f8a1f1a0
3 changed files with 20 additions and 9 deletions

View File

@@ -65,7 +65,10 @@ class _LoginScreenState extends ConsumerState<LoginScreen> {
// Navigate on auth state changes
ref.listen<AuthState>(authProvider, (previous, next) {
if (next.status == AuthStatus.authenticated) {
context.go('/home');
// 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');
}
// Navigate to 2FA verification screen
if (next.requiresTwoFactor && next.tempToken != null) {