fix(auth): issue with token expiration - #2727
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## staging #2727 +/- ##
===========================================
- Coverage 45.92% 45.71% -0.21%
===========================================
Files 1194 1118 -76
Lines 24964 23787 -1177
Branches 7316 7040 -276
===========================================
- Hits 11464 10874 -590
+ Misses 11515 11037 -478
+ Partials 1985 1876 -109
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Fixes expired/invalid auth token handling so the Console redirects to /login (with a redirect return path) instead of surfacing a generic error.
Changes:
- Added login redirect URL builder + redirect helper in the auth Axios interceptor.
- Redirects to login when silent token renewal fails and when API responses return
401. - Expanded unit tests around interceptor behavior and redirect URL construction.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| libs/shared/utils/src/lib/http/interceptors/auth-interceptor/auth-interceptor.tsx | Add redirect-to-login behavior on token renewal failure and 401 responses; introduce redirect URL helper. |
| libs/shared/utils/src/lib/http/interceptors/auth-interceptor/auth-interceptor.spec.ts | Update tests for interceptor URL/header behavior and add coverage for redirect URL building. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ad64660 to
aae8673
Compare
|
🎉 This PR is included in version 1.311.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
Issue: Slack thread
When the auth token expires, rather than being redirected to the login page, we were displaying a "Something went wrong!" error message. This PR fixes this issue.
Screenshots / Recordings
Testing
yarn testoryarn test -u(if you need to regenerate snapshots)yarn formatyarn lintPR Checklist
.cursor/rules)feat(service): add new Terraform service) - required for semantic-release