Module: Gitlab::OAuth::Session

Defined in:
lib/gitlab/o_auth/session.rb

Class Method Summary collapse

Class Method Details

.create(provider, ticket) ⇒ Object


4
5
6
# File 'lib/gitlab/o_auth/session.rb', line 4

def self.create(provider, ticket)
  Rails.cache.write("gitlab:#{provider}:#{ticket}", ticket, expires_in: Gitlab.config.omniauth.cas3.session_duration)
end

.destroy(provider, ticket) ⇒ Object


8
9
10
# File 'lib/gitlab/o_auth/session.rb', line 8

def self.destroy(provider, ticket)
  Rails.cache.delete("gitlab:#{provider}:#{ticket}")
end

.valid?(provider, ticket) ⇒ Boolean

Returns:

  • (Boolean)

12
13
14
# File 'lib/gitlab/o_auth/session.rb', line 12

def self.valid?(provider, ticket)
  Rails.cache.read("gitlab:#{provider}:#{ticket}").present?
end