Skip to content

User redirected back to the login page after no internet connection #19

@FaisalMohammadi

Description

@FaisalMohammadi

When their is no internet connection the state of the Auth changes to the unauthenticated and the user redirects to the login page
After making the internet available back it goes directly to the main page and the auth state is then authenticated.
It should stay authenticated or at least should stay in main page after no internet connection.
from the UX perspective it looks not good that after no internet it redirects to the Login Page, but at the back its already authenticated.

My implementation of Auth

class MainWidget extends StatelessWidget {
  const MainWidget({super.key});

  @override
  Widget build(BuildContext context) {
    final authNotifier = context.authNotifier;
    Widget widget;
    switch (authNotifier.status) {
      case AuthStatus.authenticated:
        widget = const FeedPage();
        break;
      case AuthStatus.unauthenticated:
      case AuthStatus.authenticating:
        widget = const LoginPage();
        break;
      case AuthStatus.uninitialized:
        widget = const SplashScreenWidget();
        break;
      default:
        widget = const SplashScreenWidget();
        break;
    }
    return widget;
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions