devise-twitter icon indicating copy to clipboard operation
devise-twitter copied to clipboard

Does not log user in after doing a sign_in

Open krzkrzkrz opened this issue 14 years ago • 5 comments

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?

krzkrzkrz avatar Sep 29 '10 15:09 krzkrzkrz

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.

MSch avatar Sep 29 '10 15:09 MSch

Great, just let me know when you are able to do so :-)

krzkrzkrz avatar Sep 29 '10 15:09 krzkrzkrz

Hi MSch, any updates on this?

krzkrzkrz avatar Oct 01 '10 20:10 krzkrzkrz

Same again - any updates? Has anyone come up with a workaround?

daveio avatar Feb 13 '11 21:02 daveio

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

andflett avatar Aug 11 '11 11:08 andflett