Sha256: 1c2dade0575a8d18f6639114ef1e76144806e37d1d52a223fb9c5931f75bb90e

Contents?: true

Size: 856 Bytes

Versions: 11

Compression:

Stored size: 856 Bytes

Contents

# 这个 class 只是存取 token 和 user
# 参照 JS SDK 实现的
# authing.js/src/lib/authentication/AuthenticationTokenProvider.ts 
# https://github.com/Authing/authing.js/blob/196b33fe0c7f510ca26cda4d172939e1c74cc5f7/src/lib/authentication/AuthenticationTokenProvider.ts#L7

module AuthingRuby
  module Authentication
    class AuthenticationTokenProvider
      def initialize()
        @token = nil
        @user = nil
      end

      def setToken(token = nil)
        if token
          @token = token
        end
      end

      def getToken()
        return @token
      end

      def getUser()
        return @user
      end

      def setUser(user = nil)
        if user
          @user = user
          @token = user['token']
        end
      end

      def clearUser()
        @token = nil
        @user = nil
      end

    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
authing_ruby-1.1.6 lib/authing_ruby/authentication/AuthenticationTokenProvider.rb
authing_ruby-1.1.5 lib/authing_ruby/authentication/AuthenticationTokenProvider.rb
authing_ruby-1.1.4 lib/authing_ruby/authentication/AuthenticationTokenProvider.rb
authing_ruby-1.1.3 lib/authing_ruby/authentication/AuthenticationTokenProvider.rb
authing_ruby-1.1.2 lib/authing_ruby/authentication/AuthenticationTokenProvider.rb
authing_ruby-1.1.1 lib/authing_ruby/authentication/AuthenticationTokenProvider.rb
authing_ruby-1.1.0 lib/authing_ruby/authentication/AuthenticationTokenProvider.rb
authing_ruby-1.0.9 lib/authing_ruby/authentication/AuthenticationTokenProvider.rb
authing_ruby-1.0.8 lib/authing_ruby/authentication/AuthenticationTokenProvider.rb
authing_ruby-1.0.7 lib/authing_ruby/authentication/AuthenticationTokenProvider.rb
authing_ruby-1.0.6 lib/authing_ruby/authentication/AuthenticationTokenProvider.rb