forked from External/greenlight
Users are redirected to the url they clicked login/signup from (#446)
This commit is contained in:
committed by
Jesus Federico
parent
d39a11059e
commit
a14007743f
@ -32,7 +32,17 @@ module SessionsHelper
|
||||
# If email verification is disabled, or the user has verified, go to their room
|
||||
def check_email_verified(user)
|
||||
if user.activated?
|
||||
redirect_to user.main_room
|
||||
# Get the url to redirect the user to
|
||||
url = if cookies[:return_to] && cookies[:return_to] != root_url
|
||||
cookies[:return_to]
|
||||
else
|
||||
user.main_room
|
||||
end
|
||||
|
||||
# Delete the cookie if it exists
|
||||
cookies.delete :return_to if cookies[:return_to]
|
||||
|
||||
redirect_to url
|
||||
else
|
||||
redirect_to resend_path
|
||||
end
|
||||
|
Reference in New Issue
Block a user