Skip to content

Commit

Permalink
user must be email_confirmed to log_in
Browse files Browse the repository at this point in the history
previously we were not checking if the email_confirmed attribute was
true before logging in. A new user did not have to activate email
before logging in.
  • Loading branch information
npauzenga committed Nov 8, 2015
1 parent 59897c7 commit e71c1e0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/controllers/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ def new

def create
@user = User.find_by(email: params[:session][:email].downcase)
if @user && @user.authenticate(params[:session][:password])
if @user &&
@user.authenticate(params[:session][:password]) &&
@user.email_confirmed
log_in @user
redirect_to @user
else
Expand Down

0 comments on commit e71c1e0

Please sign in to comment.