Skip to content

After sign in path #28

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

After sign in path #28

wants to merge 2 commits into from

Conversation

cavis
Copy link
Member

@cavis cavis commented May 9, 2025

Fixes #27.

As a bonus, handle nil ID_HOSTs, so you can run a test suite without needing to set that. (My config/prx_auth.rb initializer was erroring).

@@ -44,6 +44,7 @@ def prx_authenticated?

def authenticate!
if !current_user
set_after_sign_in_path
Copy link
Member Author

Choose a reason for hiding this comment

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

Previously, we were setting this session key on basically every request. Which included a bunch of "turbo preloading" of links when you just hover over them!

Now, we just explicitly set it just before we redirect to the sessions controller.

@@ -70,6 +70,7 @@ def refresh
sign_out_user
session[WILDCARD_SESSION_KEY] = wildcard

set_after_sign_in_path(request.referer.presence || "/")
Copy link
Member Author

Choose a reason for hiding this comment

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

And here's the 2nd place to set it... admins request wildcard access by clicking a link /auth/sessions/refresh?wildcard=true. So in this case, we grab the referrer, and send them back there.

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.

Stay on same page when wildcarding
1 participant