Sha256: a6ed10625cf0044829c524042924c42de78b25f888c646ba3368c943ca05dec8

Contents?: true

Size: 736 Bytes

Versions: 1

Compression:

Stored size: 736 Bytes

Contents

module RealSavvy
  module JWT
    class ShareToken < AbstractToken

      private

      def retrieve_claims
        @claims, @header = ::JWT.decode(
                              token,
                              nil,
                              false,
                            )
      rescue ::JWT::DecodeError => e
        raise ::RealSavvy::JWT::BadCredentials.new(e.message)
      end

      def validate_token
        true
      end

      def standardized_token
        token_parts = @token.split('.')
        header = Base64.urlsafe_encode64({typ:"JWT",alg:"none"}.to_json, padding: false)
        @token = [header, (token_parts.length == 1 ? token_parts[0] : token_parts[1]), nil].join('.')
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
real_savvy-0.0.8 lib/real_savvy/jwt/share_token.rb