-
Notifications
You must be signed in to change notification settings - Fork 477
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
Redirect to Original URL After Session Expiry and Re-login #6495
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
✅ Deploy Preview for care-egov-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Resolve this open redirect security issue:
POC (access while being logged out): https://deploy-preview-6495--care-egov-staging.netlify.app/session-expired?redirect=https://google.com
now it adds a / in between of the .my.subdomian |
@AshrafMd-1 The POC to redirect to a different domain still works 😅 , It can be exploited to redirect to a different website. |
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.
@AshrafMd-1 you also need to add the redirect param to /session-expired
navigate in handleResponse.ts
file.
Try to think of a different way to pass the redirect url across pages/components 🤔 Something like the session expired page can silently pass the redirect url to the login component internally without exposing it through the URL. @rithviknishad any suggestions? |
We could use the custom hook we have |
The |
Maybe we can check if the |
👋 Hi, @AshrafMd-1, This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there. |
@AshrafMd-1 it is not taking me to the original URL after the session expired https://www.loom.com/share/00dccbb8d6cb41cf80bf582eb51c6572?sid=4c94d3f8-74d6-474c-9e3e-7b59204be434 CC : @Ashesh3 @rithviknishad |
@nihal467 it works now |
LGTM |
WHAT
🤖 Generated by Copilot at a838ca7
This pull request enhances the login redirection logic to take into account the user's last visited path before session expiry. It uses the local storage to store and retrieve the
lastPath
value, which is updated by thefireRequest
function insrc/Redux/fireRequest.tsx
and used by theLogin
component insrc/Components/Auth/Login.tsx
.Proposed Changes
@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers
Merge Checklist
HOW
🤖 Generated by Copilot at a838ca7
/facility
path otherwise (link)