You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I set before_action :authenticate_with_token! in products controller and I try to create a product after I login from Postman, I get the error "Not authenticated" with the message in my server as "Filter chain halted as :authenticate_with_token! rendered or redirected Completed 401 Unauthorized". Any help on how to resolve this? Thank you in anticipation
The text was updated successfully, but these errors were encountered:
How do I go about that? I am currently following your method. This is what I have got in the authenticate.rb file @kurenn. All tests are passing but when I make a post request associating a user with another model, in your case, product, from my android app, I get Unauthorized. Please help.
`module Authenticable
def current_user
@current_user ||= User.find_by(auth_token: request.headers['Authorization'])
end
When I set before_action :authenticate_with_token! in products controller and I try to create a product after I login from Postman, I get the error "Not authenticated" with the message in my server as "Filter chain halted as :authenticate_with_token! rendered or redirected Completed 401 Unauthorized". Any help on how to resolve this? Thank you in anticipation
The text was updated successfully, but these errors were encountered: