Sha256: 5b96d6ca0e37fbe6b1795afa698c1bfc878f50a0818494a8f47d518397f69d4c

Contents?: true

Size: 497 Bytes

Versions: 45

Compression:

Stored size: 497 Bytes

Contents

require 'jwt'

module Ecom
  module Core
    class TokenAuthService
      AUTH_SECRET = '31a70abfaa57e5e77a3fc9f27aeaaf59b9a9f5355b5e16c842ee172035a8ed40bf82c1c971ecc176e4f0b4c9e6141db07fd4a5af3f7db9265e719fbe340b105a'

      def self.issue(payload)
        JWT.encode(payload, auth_secret, 'HS256')
      end

      def self.decode(token)
        JWT.decode(token, auth_secret, true, algorithm: 'HS256').first
      end

      def self.auth_secret
        AUTH_SECRET
      end
    end
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
ecom_core-1.1.20 app/services/ecom/core/token_auth_service.rb
ecom_core-1.1.19 app/services/ecom/core/token_auth_service.rb
ecom_core-1.1.18 app/services/ecom/core/token_auth_service.rb
ecom_core-1.1.17 app/services/ecom/core/token_auth_service.rb
ecom_core-1.1.16 app/services/ecom/core/token_auth_service.rb
ecom_core-1.1.15 app/services/ecom/core/token_auth_service.rb
ecom_core-1.1.14 app/services/ecom/core/token_auth_service.rb
ecom_core-1.1.13 app/services/ecom/core/token_auth_service.rb
ecom_core-1.1.12 app/services/ecom/core/token_auth_service.rb
ecom_core-1.1.11 app/services/ecom/core/token_auth_service.rb
ecom_core-1.1.10 app/services/ecom/core/token_auth_service.rb
ecom_core-1.1.9 app/services/ecom/core/token_auth_service.rb
ecom_core-1.1.8 app/services/ecom/core/token_auth_service.rb
ecom_core-1.1.7 app/services/ecom/core/token_auth_service.rb
ecom_core-1.1.6 app/services/ecom/core/token_auth_service.rb
ecom_core-1.1.5 app/services/ecom/core/token_auth_service.rb
ecom_core-1.1.4 app/services/ecom/core/token_auth_service.rb
ecom_core-1.1.3 app/services/ecom/core/token_auth_service.rb
ecom_core-1.1.2 app/services/ecom/core/token_auth_service.rb
ecom_core-1.1.1 app/services/ecom/core/token_auth_service.rb