Skip to content

Instantly share code, notes, and snippets.

@MichaelCPell
Created October 21, 2014 00:39
Show Gist options
  • Save MichaelCPell/a4377ad7ee5a55f750b8 to your computer and use it in GitHub Desktop.
Save MichaelCPell/a4377ad7ee5a55f750b8 to your computer and use it in GitHub Desktop.
class AuthController < ApplicationController
#POST /users/token
def token
user = User.find_by(email: params[:email])
if user.valid_password?(params[:password])
respond_with user.authentication_token
else
#handle bad credentials
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment