Advertisement
Guest User

Test

a guest
May 26th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.24 KB | None | 0 0
  1. def auth
  2.   user = find_by_email(email)
  3.     if user && user.password_hash == BCrypt::Engine.hash_secret(password, user.password_salt)
  4.       user
  5.   else
  6.     render json: { errors: ["wrong username or password"] }, status: :unauthorized
  7.   end
  8. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement