Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Commit

Permalink
Set expiration on cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
osahyoun committed Sep 26, 2016
1 parent 21b03eb commit dd32cba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/controllers/application_controller.rb
Expand Up @@ -69,7 +69,8 @@ def payment_methods
if current_member
PaymentMethodFetcher.new(current_member).fetch
else
PaymentMethodFetcher.new(recognized_member, filter: (cookies.signed[:payment_methods] || '').split(',')).fetch
payment_method_ids = (cookies.signed[:payment_methods] || '').split(',')
PaymentMethodFetcher.new(recognized_member, filter: payment_method_ids).fetch
end
end

Expand Down
7 changes: 6 additions & 1 deletion app/controllers/email_confirmation_controller.rb
Expand Up @@ -12,7 +12,12 @@ def verify

if verifier.success?
minutes_in_a_year = 1.year.abs / 60
cookies.signed['authentication_id'] = encode_jwt(verifier.authentication.member.token_payload, minutes_in_a_year)
encoded_jwt = encode_jwt(verifier.authentication.member.token_payload, minutes_in_a_year)

cookies.signed['authentication_id'] = {
value: encoded_jwt,
expires: 1.year.from_now
}
end

@rendered = template.render('errors' => verifier.errors).html_safe
Expand Down

0 comments on commit dd32cba

Please sign in to comment.