Created
October 21, 2014 00:39
-
-
Save MichaelCPell/a4377ad7ee5a55f750b8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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