forked from External/greenlight
GRN-56: Correctly implemented the account verification flow (#367)
* Correctly implemented the account verification flow * Fixed issues with redirect locations
This commit is contained in:
committed by
Jesus Federico
parent
5521402ee7
commit
c60e25f71c
@ -31,7 +31,11 @@ class SessionsController < ApplicationController
|
||||
if user && !user.greenlight_account?
|
||||
redirect_to root_path, alert: I18n.t("invalid_login_method")
|
||||
elsif user.try(:authenticate, session_params[:password])
|
||||
login(user)
|
||||
if user.email_verified
|
||||
login(user)
|
||||
else
|
||||
redirect_to(account_activation_path(email: user.email)) && return
|
||||
end
|
||||
else
|
||||
redirect_to root_path, alert: I18n.t("invalid_credentials")
|
||||
end
|
||||
|
Reference in New Issue
Block a user