a guest May 26th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def auth
  2.   user = User.find(params[:username])
  3.   if user.check_password(params[:password])
  4.     render json: user
  5.   else
  6.     render json: { errors: ["wrong username or password"] }, status: :unauthorized
  7.   end
  8. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand