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 to ticket url path after login (#140) #173

Merged
merged 3 commits into from
Dec 21, 2023
Merged

Conversation

willi-li-am
Copy link
Contributor

Used location states to save url in private route when user not logged in, then after login, redirects to the url.

I had an infinite loop at some point, but for some reason it's working. So please test this on your local machine first before merging. I tested every possibility and it works for me.

I also have no actual links to test this with, but in theory this works

Copy link
Collaborator

@ansonjwhe ansonjwhe left a comment

Choose a reason for hiding this comment

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

lgtm! tested with all types of private routes. make sure to remove the comment and run prettier

@@ -14,7 +14,7 @@ const Navbar = () => {
setLoading(true)
try {
await login()
navigate('/')
//navigate("/") //LoggedInRedirect already does this
Copy link
Collaborator

Choose a reason for hiding this comment

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

can remove this comment

@willi-li-am willi-li-am merged commit 904563a into master Dec 21, 2023
2 checks passed
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.

2 participants