Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

401 if user doesn't exists

  • Loading branch information...
commit a4d8b1cb3d14e92d9fdad4adef48ab505ae3dc22 1 parent e77033d
@andoriyu authored
Showing with 1 addition and 0 deletions.
  1. +1 −0  app.rb
View
1  app.rb
@@ -82,6 +82,7 @@ def current_user
end
post '/login/?' do
user = Spotter.first(:email => params[:email])
+ halt(401) unless user
halt(401) unless user.password == Digest::SHA2.hexdigest(params[:password])
session[:user_id] = user.id
redirect params[:'return-url']
Please sign in to comment.
Something went wrong with that request. Please try again.