-
-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Redirect users to login page upon 403 on getSelf #656 #662
fix: Redirect users to login page upon 403 on getSelf #656 #662
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't have this code in here. The call needs to be tapped in the platform
app
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry if the issue description wasn't descriptive enough!
User description
Description
I checked on the response status if 403 I clear storage, cookies and redirected to /auth path as you said
Fixes #656
Dependencies
N/A
Future Improvements
N/A
Mentions
@rajdip-b
Screenshots of relevant screens
N/A
Developer's checklist
If changes are made in the code:
Documentation Update
PR Type
Enhancement, Tests
Description
Implemented redirection to
/auth
on 403 response inAPIClient
.Added logic to clear local storage and cookies on 403.
Introduced unit tests to validate 403 handling and redirection.
Mocked API responses for testing various scenarios in
APIClient
.Changes walkthrough 📝
client.ts
Handle 403 response with redirection and data clearing
packages/api-client/src/core/client.ts
/auth
upon receiving a 403 status.request
method to include error handling for 403.api-client.spec.ts
Add tests for 403 handling and redirection
packages/api-client/tests/api-client.spec.ts
APIClient
.