{"action":"created","issue":{"url":"https://api.github.com/repos/lynndylanhurley/devise_token_auth/issues/135","labels_url":"https://api.github.com/repos/lynndylanhurley/devise_token_auth/issues/135/labels{/name}","comments_url":"https://api.github.com/repos/lynndylanhurley/devise_token_auth/issues/135/comments","events_url":"https://api.github.com/repos/lynndylanhurley/devise_token_auth/issues/135/events","html_url":"https://github.com/lynndylanhurley/devise_token_auth/issues/135","id":56749544,"number":135,"title":"Error when loging with facebook the second time without logout","user":{"login":"williamweckl","id":8031405,"avatar_url":"https://avatars.githubusercontent.com/u/8031405?v=3","gravatar_id":"","url":"https://api.github.com/users/williamweckl","html_url":"https://github.com/williamweckl","followers_url":"https://api.github.com/users/williamweckl/followers","following_url":"https://api.github.com/users/williamweckl/following{/other_user}","gists_url":"https://api.github.com/users/williamweckl/gists{/gist_id}","starred_url":"https://api.github.com/users/williamweckl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/williamweckl/subscriptions","organizations_url":"https://api.github.com/users/williamweckl/orgs","repos_url":"https://api.github.com/users/williamweckl/repos","events_url":"https://api.github.com/users/williamweckl/events{/privacy}","received_events_url":"https://api.github.com/users/williamweckl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-05T23:58:55Z","updated_at":"2015-02-06T00:08:58Z","closed_at":null,"body":"Error:\r\n\r\n    NoMethodError in DeviseTokenAuth::OmniauthCallbacksController#omniauth_success\r\n\r\n    undefined method `[]' for nil:NilClass\r\n\r\n    Extracted source (around line #24):\r\n        \r\n      22 # find or create user by provider and provider uid\r\n      23 @resource = resource_class.where({\r\n      24  uid:      auth_hash['uid'],\r\n      25  provider: auth_hash['provider']\r\n      26 }).first_or_initialize\r\n\r\nHow to reproduce:\r\n1- Login with facebook using omniauth-facebook\r\n2- Remove the auth token cookie\r\n3- Click again on facebook login button"},"comment":{"url":"https://api.github.com/repos/lynndylanhurley/devise_token_auth/issues/comments/73157262","html_url":"https://github.com/lynndylanhurley/devise_token_auth/issues/135#issuecomment-73157262","issue_url":"https://api.github.com/repos/lynndylanhurley/devise_token_auth/issues/135","id":73157262,"user":{"login":"williamweckl","id":8031405,"avatar_url":"https://avatars.githubusercontent.com/u/8031405?v=3","gravatar_id":"","url":"https://api.github.com/users/williamweckl","html_url":"https://github.com/williamweckl","followers_url":"https://api.github.com/users/williamweckl/followers","following_url":"https://api.github.com/users/williamweckl/following{/other_user}","gists_url":"https://api.github.com/users/williamweckl/gists{/gist_id}","starred_url":"https://api.github.com/users/williamweckl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/williamweckl/subscriptions","organizations_url":"https://api.github.com/users/williamweckl/orgs","repos_url":"https://api.github.com/users/williamweckl/repos","events_url":"https://api.github.com/users/williamweckl/events{/privacy}","received_events_url":"https://api.github.com/users/williamweckl/received_events","type":"User","site_admin":false},"created_at":"2015-02-06T00:08:58Z","updated_at":"2015-02-06T00:08:58Z","body":"* yes\r\n* yes\r\n* I've added `callback_url`\r\n\r\nMy first login is successful. The problem happens only when I remove the cookie and try to login again. "}}