Guest User

Untitled

a guest
Aug 24th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. rails authentication for an API
  2. <server>/users/connect
  3.  
  4. def connect
  5. user = User.find_by_email(params[:email])
  6. password = params[:password]
  7. # here is the part I'm pseudo coding out
  8. if user.is_valid_password(password)
  9. ...do my stuff...
  10. end
  11.  
  12. render :json ...etc...
  13. end
  14.  
  15. config.token_authentication_key = :nameofyourapikeyhere
  16.  
  17. devise … token_authenticatable, ...
Add Comment
Please, Sign In to add comment