Jani
Jani

Reputation: 1490

Expiring authentication token in Devise

I'm generating an authentication token using token = Devise.friendly_token. I want to know how I can expire this token in lets say 24hours ?

Upvotes: 0

Views: 3744

Answers (2)

Brocoders
Brocoders

Reputation: 1

You could use particular JWT Authentication Ruby Gem, that fully complements 'Devise' with desired features for authentication, you may look at it on github.

Upvotes: 0

THaynes
THaynes

Reputation: 71

In the intializers directory there should be a devise.rb file.

You can change the various options there. I believe what you are looking for is one of the following

config.rememember_for = 24.hours
config.timeout_in = 24.hours

The first is related to :rememberable (the time user can go without being asked for credentials) and the second is related to :timeoutable (amount of time without activity before session times out).

Upvotes: 2

Related Questions