Skip to content

Conversation

@Sembauke
Copy link
Member

Checklist:

Closes #XXXXX

@Sembauke Sembauke requested a review from a team as a code owner October 16, 2025 13:52
Copy link
Member

@huyenltnguyen huyenltnguyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm hesitant to hit approve as Niraj is probably more qualified to review this change.


Though I wonder if we could handle the errors globally, in the Dio service as well / instead:

// In dio_service.dart
dio.interceptors.add(
  InterceptorsWrapper(
    onError: (DioException error, ErrorInterceptorHandler handler) async {
      if (error.response?.statusCode == 401 || 
          error.response?.statusCode == 403) {
        await locator<AuthenticationService>().logout();
      }
    },
  ),
);

await fetchUser();
} else {
log('message: No valid credentials found');
logout();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean the logout logic has been missing the whole time? 😮

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well it wasn't being checked when starting the app, otherwise it was.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants