devise-twitter
devise-twitter copied to clipboard
Does not log user in after doing a sign_in
This only happens when a user is registering for the first time.
Devise-twitter does not log the user in after navigating to /user/sign_in
It saves the user in the db, but does not log the user. To log the user in, the user would have to navigate to /user/sign_in a second time
Am I missing something or is this a bug?
This is definitely a bug. I just updated the app I'm using devise-twitter on to warden 1.0 and am in the process of fixing this.
Great, just let me know when you are able to do so :-)
Hi MSch, any updates on this?
Same again - any updates? Has anyone come up with a workaround?
When creating a user and signing in the order of events is a little out, the user isn't properly added to the database until after the sign in call is made. There's probably a better fix for this, but in the meantime you can edit rack.rb in your devise-twitter gem and add:
warden.set_user(strategy.user, :event => :authentication, :scope => scope)
... on line 20 (in short: duplicate line 19)
Seems this adds to user to the database and performs authentication, calling it twice doesn't seem to do any harm, and sorts out the issue.
Hackymchackson