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

fix redirect after login #1056

Merged
merged 2 commits into from
Jun 11, 2023
Merged

fix redirect after login #1056

merged 2 commits into from
Jun 11, 2023

Conversation

joschahenningsen
Copy link
Member

Motivation and Context

The redirect after logins is currently broken. This fixes #1053

Description

The redirect target cookie is now properly parsed and set when visiting the login page as opposed to when submitting the login form. This fixes issues with saml logins.

@github-actions
Copy link

github-actions bot commented Jun 6, 2023

Your Testserver will be ready at https://1056.test.live.mm.rbg.tum.de in a few minutes.

Logins
Kurs1 Kurs2 Kurs3 Kurs4
public public loggedin enrolled
prof1 prof1 prof2 prof1
prof2
student1
student2
student3
student1
student2
student2
student3
student1
student2

@joschahenningsen joschahenningsen marked this pull request as draft June 6, 2023 11:47
@joschahenningsen joschahenningsen marked this pull request as ready for review June 7, 2023 07:12
@joschahenningsen
Copy link
Member Author

I removed the frontend logic of using the document.referrer for this case, as it only worked when the browser set it and when using the login form. Now, the referrer cookie is set upon loading the login page when the login page has the ?return=... query. (Which is the case when a page was accessed that requires login but no session is present)

Copy link
Collaborator

@alexanderstephan alexanderstephan left a comment

Choose a reason for hiding this comment

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

I can't really test this right now, but the changes look good to me. I think the cookie workaround is perfectly sane.

@joschahenningsen joschahenningsen merged commit 5c2c823 into dev Jun 11, 2023
@joschahenningsen joschahenningsen deleted the fix-login-redirect branch June 11, 2023 19:44
SebiWrn pushed a commit that referenced this pull request May 7, 2024
* fix redirect after login

* remove logic to redirect to referer
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.

Remember what link was clicked on before having to login
3 participants