2017-01-24 20:10:40 +00:00
|
|
|
# frozen_string_literal: true
|
2017-10-17 01:15:47 +00:00
|
|
|
|
2017-01-24 20:10:40 +00:00
|
|
|
Warden::Manager.after_set_user do |user, auth, opts|
|
2017-01-03 21:12:58 +00:00
|
|
|
scope = opts[:scope]
|
|
|
|
auth.cookies.signed["#{scope}.id"] = user.id
|
|
|
|
auth.cookies.signed["#{scope}.expires_at"] = 30.minutes.from_now
|
|
|
|
end
|
2017-01-24 20:10:40 +00:00
|
|
|
Warden::Manager.before_logout do |_user, auth, opts|
|
2017-01-03 21:12:58 +00:00
|
|
|
scope = opts[:scope]
|
|
|
|
auth.cookies.signed["#{scope}.id"] = nil
|
|
|
|
auth.cookies.signed["#{scope}.expires_at"] = nil
|
|
|
|
end
|