Redirecting the user to the referrer on login success/fail (#374)

This commit is contained in:
farhatahmad
2019-03-04 15:51:53 -05:00
committed by Jesus Federico
parent a0036e244b
commit 404134aa8d
3 changed files with 14 additions and 2 deletions

View File

@ -32,7 +32,11 @@ module SessionsHelper
# If email verification is disabled, or the user has verified, go to their room
def check_email_verified(user)
if !Rails.configuration.enable_email_verification || user.email_verified
redirect_to user.main_room
if request.referrer.present?
redirect_to request.referrer
else
redirect_to user.main_room
end
else
redirect_to resend_path
end