Guest User

Untitled

a guest
Apr 6th, 2018
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.46 KB | None | 0 0
  1.     post '/login' do
  2.       email = @request_payload[:email]
  3.       password = @request_payload[:password]
  4.       #id = User.find_id_by_mail(email) # No esta mal solo el read.
  5.       # instancia = User.filter({email => ...})
  6.       id = User.filter({"@email"=>email})
  7.       puts id
  8.       user = User.find(id)
  9.       if user.nil?
  10.         halt 401
  11.       elsif user.password != password || password.nil?
  12.         halt 403
  13.       end
  14.       user.log_result.to_json
  15.     end
Add Comment
Please, Sign In to add comment