{"action":"closed","issue":{"url":"https://api.github.com/repos/lynndylanhurley/devise_token_auth/issues/357","labels_url":"https://api.github.com/repos/lynndylanhurley/devise_token_auth/issues/357/labels{/name}","comments_url":"https://api.github.com/repos/lynndylanhurley/devise_token_auth/issues/357/comments","events_url":"https://api.github.com/repos/lynndylanhurley/devise_token_auth/issues/357/events","html_url":"https://github.com/lynndylanhurley/devise_token_auth/issues/357","id":103138232,"number":357,"title":"invalid token in method set_user_by_token on RegistrationsController#update","user":{"login":"abhayastudios","id":1121217,"avatar_url":"https://avatars.githubusercontent.com/u/1121217?v=3","gravatar_id":"","url":"https://api.github.com/users/abhayastudios","html_url":"https://github.com/abhayastudios","followers_url":"https://api.github.com/users/abhayastudios/followers","following_url":"https://api.github.com/users/abhayastudios/following{/other_user}","gists_url":"https://api.github.com/users/abhayastudios/gists{/gist_id}","starred_url":"https://api.github.com/users/abhayastudios/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhayastudios/subscriptions","organizations_url":"https://api.github.com/users/abhayastudios/orgs","repos_url":"https://api.github.com/users/abhayastudios/repos","events_url":"https://api.github.com/users/abhayastudios/events{/privacy}","received_events_url":"https://api.github.com/users/abhayastudios/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-25T23:31:11Z","updated_at":"2015-08-26T18:05:38Z","closed_at":"2015-08-26T18:05:38Z","body":"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.\r\n\r\nWhen 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.\r\n\r\nNow 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.\r\n\r\nAnother 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.\r\n\r\nAny ideas what might be going on? Is this a bug or am I doing something wrong here?\r\n\r\nThanks!"}}