Skip to content

Commit

Permalink
Revert "fix(mobile): random logout (#8739)" (#8954)
Browse files Browse the repository at this point in the history
This reverts commit 97c099e.
  • Loading branch information
alextran1502 authored Apr 20, 2024
1 parent caf76f0 commit 7ec62f1
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions mobile/lib/shared/views/splash_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class SplashScreenPage extends HookConsumerWidget {
void performLoggingIn() async {
bool isSuccess = false;
bool deviceIsOffline = false;

if (accessToken != null && serverUrl != null) {
try {
// Resolve API server endpoint from user provided serverUrl
Expand All @@ -51,11 +50,15 @@ class SplashScreenPage extends HookConsumerWidget {
offlineLogin: deviceIsOffline,
);
} catch (error, stackTrace) {
ref.read(authenticationProvider.notifier).logout();

log.severe(
'Cannot set success login info',
error,
stackTrace,
);

context.pushRoute(const LoginRoute());
}
}

Expand All @@ -73,11 +76,6 @@ class SplashScreenPage extends HookConsumerWidget {
}
context.replaceRoute(const TabControllerRoute());
} else {
log.severe(
'Unable to login through offline or online methods - logging out completely',
);

ref.read(authenticationProvider.notifier).logout();
// User was unable to login through either offline or online methods
context.replaceRoute(const LoginRoute());
}
Expand Down

0 comments on commit 7ec62f1

Please sign in to comment.