开发者

Keep User Signed in with Devise

开发者 https://www.devze.com 2023-02-22 19:55 出处:网络
I\'m manually signing in my users ( a la: sign_in(user) ) because they are being authenticated via a 3rd party API (using OmniAuth).

I'm manually signing in my users ( a la: sign_in(user) ) because they are being authenticated via a 3rd party API (using OmniAuth).

However, doing this, my user only stays logged in for like 30 seconds (verifying with user_signed_in?(user) -- current_user still holds the signed in user ).

Is there somethi开发者_StackOverflowng I need to do to keep user_signed_in?() from returning false soon after signing in the user?

Thank you for any help.


Take a look at Devise::Models::Timeoutable documentation.


Found the answer on SO here

For whatever reason, the default rails.js killed the session whenever a .js call was made. The solution is to update rails.js (from here).

0

精彩评论

暂无评论...
验证码 换一张
取 消