Skip to content

Help with figuring out session resets on JSON login and account creation flows #280

Answered by janko
FelipeBodelon asked this question in Q&A
Discussion options

You must be logged in to vote

Rodauth resets the session after login because it's a good general security practice, as it should prevent session hijacking. Did you try using Rodauth login's native functionality for returning to originally requested location, turned on by setting login_return_to_requested_location? true? Though JSON API will not show redirect locations, so you'd have to expose it in the JSON response, something like:

login_return_to_requested_location? true
login_response do
  json_response[:return_to] = saved_login_redirect if saved_login_redirect
  super()
end

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@FelipeBodelon
Comment options

@janko
Comment options

Answer selected by FelipeBodelon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants