Authentication with Rails authenticate with http token
suggest changeauthenticate_with_http_token do |token, options|
@user = User.find_by(auth_token: token)
end
Test the action with curl. -H sets the header; do not use -I, which sends a HEAD request and hides the body:
curl -H "Authorization: Token token=my-token" http://localhost:3000
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents