2019-10-20 08:47:26 +00:00
|
|
|
Warden::Manager.after_set_user do |user, auth, opts|
|
2019-08-14 09:48:44 +00:00
|
|
|
scope = opts[:scope]
|
|
|
|
auth.cookies.signed["#{scope}.id"] = user.id
|
|
|
|
auth.cookies.signed["#{scope}.expires_at"] = 30.minutes.from_now
|
|
|
|
end
|
|
|
|
|
2019-10-20 08:47:26 +00:00
|
|
|
Warden::Manager.before_logout do |_user, auth, opts|
|
2019-08-14 09:48:44 +00:00
|
|
|
scope = opts[:scope]
|
|
|
|
auth.cookies.signed["#{scope}.id"] = nil
|
|
|
|
auth.cookies.signed["#{scope}.expires_at"] = nil
|
|
|
|
end
|