Sha256: 556e9e10d94acf89a0bf86403e2dda489ad7dc62dcbe99de2dc9e178f12b0dc3

Contents?: true

Size: 268 Bytes

Versions: 2

Compression:

Stored size: 268 Bytes

Contents

# frozen_string_literal: true

module JsonWebToken
  RAILS_SECRET = ENV["RAILS_SECRET_KEY"]

  def self.encode(payload)
    JWT.encode(payload, RAILS_SECRET)
  end

  def self.decode(payload)
    JWT.decode(payload, RAILS_SECRET)[0].transform_keys(&:to_sym)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
n_base_rails-0.1.2 lib/lib/json_web_token.rb
n_base_rails-0.1.1 lib/lib/json_web_token.rb