Domanda

I am implementing devise user authentication on a Rails 4 App and was wondering how do I stop the App from logging the User out after a certain amount of time. I want a user not to be signed out unless they click the sign out button, I believe this is called permanent login.

È stato utile?

Soluzione

If you look inside config/initializers/devise.rb you will find configuration settings that include config.timeout_in.

It is also possible to set it within the model:

class User < ActiveRecord::Base
  devise :timeoutable, timeout_in: 15.minutes
end

Check this link for more information.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top