Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid token in method set_user_by_token on RegistrationsController#update #357

Closed
abhayastudios opened this issue Aug 25, 2015 · 2 comments

Comments

@abhayastudios
Copy link

I have an issue with device_token_auth v0.1.34, where I get a 404 User not found when I do an update in the RegistrationsController. For the client side I use ng-token-auth v0.0.28.

When I look at the method set_user_by_token in the set_user_by_token.rb concern, then I see that the expression "user.valid_token?(@token, @client_id)" on line 54 evaluates to false. I do see however that the request headers include a token and client that correspond to the values of the client and token at that point in the set_user_by_token method.

Now the weird thing is that as part of my login procedure, I also perform an update to update the user object with a field that I get from an external resource. This first update works just fine in all cases.

Another thing is that these updates work fine for the first user I login with, but then when I log out and authenticate with another user then everything works smooth until I try to update.

Any ideas what might be going on? Is this a bug or am I doing something wrong here?

Thanks!

@abhayastudios
Copy link
Author

Mea culpa! I had forgotten to remove the $http.get option {withCredentials: true} that had been there before I added ng-token-auth. Closing this issue.

@abhayastudios
Copy link
Author

@ACPK

As I wrote in the comment above, I made the mistake of leaving in the {withCredentials: true} option for my $http.get calls after starting to work with ng-token-auth. Once I removed that option it started to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant