2a34255e0b
Co-authored-by: Subin <subinthattaparambil@gmail.com> Co-authored-by: Manoj <manojmj92@gmail.com> Co-authored-by: Nithin <webofnithin@gmail.com>
11 lines
366 B
Ruby
11 lines
366 B
Ruby
Warden::Manager.after_set_user do |user,auth,opts|
|
|
scope = opts[:scope]
|
|
auth.cookies.signed["#{scope}.id"] = user.id
|
|
auth.cookies.signed["#{scope}.expires_at"] = 30.minutes.from_now
|
|
end
|
|
|
|
Warden::Manager.before_logout do |user, auth, opts|
|
|
scope = opts[:scope]
|
|
auth.cookies.signed["#{scope}.id"] = nil
|
|
auth.cookies.signed["#{scope}.expires_at"] = nil
|
|
end
|