Redirects after verify account from email #249
-
Hey, Janko. I am implementing a functionality that after registration/login users would go to a certain page by redirect, I implemented it by passing an additional parameter in the link and on the backend I check, if there is a certain link I write the following into the session
then Rodauth after authorization redirects me to where I want and it seems to work in 3 cases out of 4.
but it doesn't work in case when user sign up via mail because it sends an email I tried to add an additional parameter in url (where to redirect to) manually in the link from email for verification to test the theory, in but the problem is that when the code reaches |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
In the 3 cases that you mentioned, all of them call the You could try saving it in an instance variable instead: before_verify_account_route do
if request.get?
session[:verify_account_redirect] = param('redirect_to_path')
elsif request.post?
@verify_account_redirect = session[:verify_account_redirect]
end
end
verify_account_redirect { @verify_account_redirect || super() } |
Beta Was this translation helpful? Give feedback.
In the 3 cases that you mentioned, all of them call the
#login
method, which handlessession[login_redirect_session_key]
. When the account is verified, the autologin that's performed doesn't call the#login
method, but updates the session directly, clearingsession[login_redirect_session_key]
beforeverify_account_redirect
is reached.You could try saving it in an instance variable instead: