Skip to content

Commit

Permalink
Fix for #48
Browse files Browse the repository at this point in the history
  • Loading branch information
soupmatt committed Sep 6, 2012
1 parent 3930127 commit fe21a05
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/casclient/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def configure(conf)
when :local_dir_ticket_store, nil
CASClient::Tickets::Storage::LocalDirTicketStore
when :active_record_ticket_store
::ACTIVE_RECORD_TICKET_STORE
CASClient::Tickets::Storage::ACTIVE_RECORD_TICKET_STORE
else
conf[:ticket_store]
end
Expand Down
13 changes: 12 additions & 1 deletion lib/casclient/tickets/storage/active_record_ticket_store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def initialize(config={})
if config[:pgtious_table_name]
CasPgtiou.set_table_name = config[:pgtious_table_name]
end
ActiveRecord::SessionStore.session_class = ServiceTicketAwareSession
end

def store_service_session_lookup(st, controller)
Expand Down Expand Up @@ -63,7 +64,17 @@ def retrieve_pgt(pgt_iou)

end

::ACTIVE_RECORD_TICKET_STORE = ActiveRecordTicketStore
ACTIVE_RECORD_TICKET_STORE = ActiveRecordTicketStore

class ServiceTicketAwareSession < ActiveRecord::SessionStore::Session
before_save :save_service_ticket

def save_service_ticket
if data[:service_ticket]
self.service_ticket = data[:service_ticket]
end
end
end

class CasPgtiou < ActiveRecord::Base
#t.string :pgt_iou, :null => false
Expand Down

0 comments on commit fe21a05

Please sign in to comment.