Welcome to mirror list, hosted at ThFree Co, Russian Federation.

session.rb « o_auth « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 30739f2a2c5f3c12a9eb21bdef796ceebc5aa18a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# :nocov:
module Gitlab
  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
# :nocov: