ruby on rails 3 - Previous user picked up with auth_token login in Devise -


here's scenario.

first, log in alice: http://localhost:3000/?auth_token=emxbk8cujma1etzfmigb then, without logging out, log in bob: http://localhost:3000?auth_token=z9ui7cw_xcnomgwoeueh

what happens is, after second request, i'm still logged in alice, not bob. if http://localhost:3000/users/sign_out in between 2 auth_token logins, everything's ok. without sign_out, bob can't login using token.

is bug, or way things should due security issues i'm ignorant of? can behavior overriden through hooks?

devise's token_authenticatable strategy login path. sending user's authentication_token devise log in user , set session, logging in via web would. not supposed act api key, required sent on every request , knowledge of request disappears once server responds.

take @ issue here more information: https://github.com/plataformatec/devise/issues/300

@jschorr's answer work if wish use more api key, should aware original issue not persist previous user's session between different clients, not security issue of sessions leaking between clients, , how authors of devise intended. need log out of significant other's webmail account in order check own if checked mail same computer, need send logout message rails app before can switch accounts.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -