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.2.12 app/services/ecom/core/token_auth_service.rb
ecom_core-1.2.11 app/services/ecom/core/token_auth_service.rb
ecom_core-1.2.10 app/services/ecom/core/token_auth_service.rb
ecom_core-1.2.9 app/services/ecom/core/token_auth_service.rb
ecom_core-1.2.7 app/services/ecom/core/token_auth_service.rb
ecom_core-1.2.6 app/services/ecom/core/token_auth_service.rb
ecom_core-1.2.5 app/services/ecom/core/token_auth_service.rb
ecom_core-1.2.4 app/services/ecom/core/token_auth_service.rb
ecom_core-1.2.3 app/services/ecom/core/token_auth_service.rb
ecom_core-1.2.2 app/services/ecom/core/token_auth_service.rb
ecom_core-1.2.1 app/services/ecom/core/token_auth_service.rb
ecom_core-1.2.0 app/services/ecom/core/token_auth_service.rb
ecom_core-1.1.28 app/services/ecom/core/token_auth_service.rb
ecom_core-1.1.27 app/services/ecom/core/token_auth_service.rb
ecom_core-1.1.26 app/services/ecom/core/token_auth_service.rb
ecom_core-1.1.25 app/services/ecom/core/token_auth_service.rb
ecom_core-1.1.24 app/services/ecom/core/token_auth_service.rb
ecom_core-1.1.23 app/services/ecom/core/token_auth_service.rb
ecom_core-1.1.22 app/services/ecom/core/token_auth_service.rb
ecom_core-1.1.21 app/services/ecom/core/token_auth_service.rb