summaryrefslogtreecommitdiff
path: root/lib/gitlab/auth/o_auth/session.rb
blob: 8f2b4d585524a1680d427be1731fec58701512d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# :nocov:
module Gitlab
  module Auth
    module OAuth
      module Session
        def self.create(provider, ticket)
          Rails.cache.write("gitlab:#{provider}:#{ticket}", ticket, expires_in: Gitlab.config.omniauth.cas3.session_duration)
        end

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

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