Rails 身份验证使用 http 令牌进行身份验证

authenticate_with_http_token do |token, options|
  @user = User.find_by(auth_token: token)
end

你可以通过发出类似请求来测试此端点与 curl

curl -IH "Authorization: Token token=my-token" http://localhost:3000