Skip to content
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 not working upon login #6900

Closed
2 tasks done
rithviknishad opened this issue Dec 24, 2023 · 4 comments · Fixed by #7237
Closed
2 tasks done

Redirect not working upon login #6900

rithviknishad opened this issue Dec 24, 2023 · 4 comments · Fixed by #7237
Assignees
Labels
bug Something isn't working

Comments

@rithviknishad
Copy link
Member

rithviknishad commented Dec 24, 2023

Describe the bug
If a user is logged out and they go to a specific URL directly, they are not landing on that URL after login.

To Reproduce
Steps to reproduce the behavior:

  1. Ensure you are logged out
  2. Visit https://care.ohc.network/facility/ea9a2fbe-74f3-446b-bdb0-e038766bfb09/cns?page=1&limit=6
  3. Enter credentials
  4. Expected: "CNS Page of a Facility", Got: "Facilities List Page"

Tasks

  • The user should be redirected to the specific URL when logged in.
  • Write Cypress Test to test this behaviour.
@rithviknishad rithviknishad added the bug Something isn't working label Dec 24, 2023
@Om-Thorat
Copy link

@rithviknishad Can you assign this to me?

const getRedirectURL = () => {
  return new URLSearchParams(window.location.search).get("redirect");
};

The problem is probably the getRedirectURL function which always returns null

@Om-Thorat
Copy link

@rithviknishad This is a code design decision seems like the component expects an extra ?redirect= param at the end of string to redirect to, This isn't needed since the login page is shown on the same url that the user intends to go to. One way would be to redirect to the login page with a redirect param or another easier way might be to just use current url and just redirect to that after login.

@rithviknishad
Copy link
Member Author

The second approach sounds good!

@Om-Thorat
Copy link

Great! I'll get to it

@rithviknishad rithviknishad self-assigned this Feb 20, 2024
rithviknishad added a commit that referenced this issue Feb 20, 2024
khavinshankar pushed a commit that referenced this issue Feb 28, 2024
* Fixes redirect not working upon login

fixes #6900

* Add cypress tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants