Ruby on Rails - authentication with rails authenticate_with_http_token in ruby on rails - ruby on rails tutorial - rails guides - rails tutorial - ruby rails
authentication with rails authenticate_with_http_token
authenticate_with_http_token do |token, options|
@user = User.find_by(auth_token: token)
end
Clicking "Copy Code" button will copy the code into the clipboard - memory. Please paste(Ctrl+V) it in your destination. The code will get pasted. Happy coding from Wikitechy - ruby on rails tutorial - rails guides - ruby rails - rubyonrails - learn ruby on rails - team
We can test this endpoint with curl by making a request like
curl -IH "Authorization: Token token=my-token" http://localhost:3000