Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Commit

Permalink
Handle cookie_expiry_time in SecondFactorAuthenticationAcceptor
Browse files Browse the repository at this point in the history
  • Loading branch information
pencil committed Mar 29, 2013
1 parent 4c32ea2 commit 766e352
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/casino/listener/second_factor_authentication_acceptor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ def user_not_logged_in
@controller.redirect_to login_path
end

def user_logged_in(url, ticket_granting_ticket)
@controller.cookies[:tgt] = ticket_granting_ticket
def user_logged_in(url, ticket_granting_ticket, cookie_expiry_time = nil)
@controller.cookies[:tgt] = { value: ticket_granting_ticket, expires: cookie_expiry_time }
if url.nil?
@controller.redirect_to sessions_path, status: :see_other
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

it 'creates the tgt cookie' do
listener.user_logged_in(url, ticket_granting_ticket)
controller.cookies[:tgt].should == ticket_granting_ticket
controller.cookies[:tgt].should == { value: ticket_granting_ticket, expires: nil }
end
end
end
Expand Down

0 comments on commit 766e352

Please sign in to comment.