Skip to content

Commit

Permalink
fix: small code fix
Browse files Browse the repository at this point in the history
  • Loading branch information
byroot committed Mar 16, 2011
1 parent aab946a commit 9a4b1ab
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions app/controllers/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@ def new
end

def create
user = User.authenticate(params[:email], params[:password])
if user
self.current_user = user

if self.current_user = User.authenticate(params[:email], params[:password])
flash[:notice] = "Logged in successfully."
redirect_to params[:redirect].presence || groups_url
else
#logout_killing_session!
flash.now[:error] = "Invalid login or password."
render :action => 'new'
render :new
end
end

Expand Down

0 comments on commit 9a4b1ab

Please sign in to comment.