Skip to content

fix: auth session issue#1672

Closed
Sembauke wants to merge 1 commit intofreeCodeCamp:mainfrom
Sembauke:fix/auth-issue-with-sessions
Closed

fix: auth session issue#1672
Sembauke wants to merge 1 commit intofreeCodeCamp:mainfrom
Sembauke:fix/auth-issue-with-sessions

Conversation

@Sembauke
Copy link
Copy Markdown
Member

Checklist:

Closes #XXXXX

@Sembauke Sembauke requested a review from a team October 16, 2025 13:52
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Copy link
Copy Markdown

@damianczer damianczer left a comment

Choose a reason for hiding this comment

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

ok

@Nirajn2311 Nirajn2311 requested a review from a team as a code owner January 21, 2026 01:29
@Sembauke Sembauke closed this Jan 27, 2026
@Sembauke Sembauke deleted the fix/auth-issue-with-sessions branch March 2, 2026 19:43
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.

3 participants