Skip to content

Commit

Permalink
Merge pull request #146 from psu-group-projects/invalid-login-fix
Browse files Browse the repository at this point in the history
Change @session.save! to @session.save to avoid exceptions
  • Loading branch information
scoz committed Mar 22, 2012
2 parents a3a7c0b + e4a2071 commit 83c52bf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/controllers/user_sessions_controller.rb
Expand Up @@ -24,13 +24,12 @@ def create
end

@session = UserSession.new(params[:user_session], login_type: login_type)

if @session.save!
if @session.save
flash[:success] = "Login successful"
redirect_back_or_default home_path
else
flash[:alert] = "Invalid login"
render :action => :new
redirect_to :login
end
end

Expand Down

0 comments on commit 83c52bf

Please sign in to comment.