{"action":"created","issue":{"url":"https://api.github.com/repos/NoamB/sorcery/issues/800","repository_url":"https://api.github.com/repos/NoamB/sorcery","labels_url":"https://api.github.com/repos/NoamB/sorcery/issues/800/labels{/name}","comments_url":"https://api.github.com/repos/NoamB/sorcery/issues/800/comments","events_url":"https://api.github.com/repos/NoamB/sorcery/issues/800/events","html_url":"https://github.com/NoamB/sorcery/issues/800","id":176831295,"number":800,"title":"In External Twitter login, a bug occurs undefined method 'username=' for User.","user":{"login":"ebihara99999","id":7948153,"avatar_url":"https://avatars.githubusercontent.com/u/7948153?v=3","gravatar_id":"","url":"https://api.github.com/users/ebihara99999","html_url":"https://github.com/ebihara99999","followers_url":"https://api.github.com/users/ebihara99999/followers","following_url":"https://api.github.com/users/ebihara99999/following{/other_user}","gists_url":"https://api.github.com/users/ebihara99999/gists{/gist_id}","starred_url":"https://api.github.com/users/ebihara99999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ebihara99999/subscriptions","organizations_url":"https://api.github.com/users/ebihara99999/orgs","repos_url":"https://api.github.com/users/ebihara99999/repos","events_url":"https://api.github.com/users/ebihara99999/events{/privacy}","received_events_url":"https://api.github.com/users/ebihara99999/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-14T07:07:16Z","updated_at":"2016-09-14T14:15:33Z","closed_at":null,"body":"Thank you for the great project Sorcery.\r\n\r\nUsing Sorcery to make an application, I have a problem with external twitter login.\r\n\r\n* I Implement as the External page in Wiki.\r\n\r\n* I can access to \"Authorize Sample-App to use your account\" page.\r\n\r\n* But on the page, input username/email and password and click \"Sign in\", it redirects to the root page without login.\r\n\r\n* I debugged and found the bug seems to occur at create_from_provider in  lib/sorcery/model/submodules/external.rb ( Following is the source).  \r\n```ruby\r\ndef create_from_provider(provider, uid, attrs)\r\n  user = new\r\n  attrs.each do |k,v|\r\n    user.send(:\"#{k}=\", v)\r\n  end\r\n```\r\nSuppose the username is \"sample-username\" and the email address is \"user@sample.com\".\r\nThen the argument, attrs is Hash including\r\n```ruby\r\nusername: \"sample-username\"\r\n```\r\nWhen `user.send` executed, it raises NoMethodError:\r\n```\r\nundefined method 'username=' for #<User:0x007f01e80e6c08>\r\n```\r\n\r\nHow do I fix this? Or some improvement in my code?  \r\nI would appreciate if someone tells me suggestion.\r\n\r\nLast my environment is:\r\n* Sorcery: 0.9.1\r\n* Rails: 4.2.5\r\n* Ruby: 2.3.1\r\n"},"comment":{"url":"https://api.github.com/repos/NoamB/sorcery/issues/comments/247026908","html_url":"https://github.com/NoamB/sorcery/issues/800#issuecomment-247026908","issue_url":"https://api.github.com/repos/NoamB/sorcery/issues/800","id":247026908,"user":{"login":"Ch4s3","id":1943540,"avatar_url":"https://avatars.githubusercontent.com/u/1943540?v=3","gravatar_id":"","url":"https://api.github.com/users/Ch4s3","html_url":"https://github.com/Ch4s3","followers_url":"https://api.github.com/users/Ch4s3/followers","following_url":"https://api.github.com/users/Ch4s3/following{/other_user}","gists_url":"https://api.github.com/users/Ch4s3/gists{/gist_id}","starred_url":"https://api.github.com/users/Ch4s3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ch4s3/subscriptions","organizations_url":"https://api.github.com/users/Ch4s3/orgs","repos_url":"https://api.github.com/users/Ch4s3/repos","events_url":"https://api.github.com/users/Ch4s3/events{/privacy}","received_events_url":"https://api.github.com/users/Ch4s3/received_events","type":"User","site_admin":false},"created_at":"2016-09-14T14:15:33Z","updated_at":"2016-09-14T14:15:33Z","body":"Let me look into this. In the meantime can you try pointing your gemfile to master:\r\n```gem \"sorcery\", git: \"https://github.com/NoamB/sorcery\", branch: \"master\"```\r\n\r\nThis issue may be fixed on master, and we're trying to put together a release soon."}}
{"actor":{"display_login":"Ch4s3"}}