Sha256: 868a9031ad0f61bb7d92bdddd41dcf0cd9c85671fc5c6f87f9eb4fbf17643c66

Contents?: true

Size: 295 Bytes

Versions: 15

Compression:

Stored size: 295 Bytes

Contents

class JsonWebToken
  class << self
    def encode(payload)
      JWT.encode(payload, Rails.application.secrets.secret_key_base)
    end

    def decode(token)
      body = JWT.decode(token, Rails.application.secrets.secret_key_base)[0]
      HashWithIndifferentAccess.new body
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
sis_core-1.0.20 lib/json_web_token.rb
sis_core-1.0.19 lib/json_web_token.rb
sis_core-1.0.18 lib/json_web_token.rb
sis_core-1.0.17 lib/json_web_token.rb
sis_core-1.0.16 lib/json_web_token.rb
sis_core-1.0.15 lib/json_web_token.rb
sis_core-1.0.14 lib/json_web_token.rb
sis_core-1.0.13 lib/json_web_token.rb
sis_core-1.0.12 lib/json_web_token.rb
sis_core-1.0.11 lib/json_web_token.rb
sis_core-1.0.10 lib/json_web_token.rb
sis_core-1.0.9 lib/json_web_token.rb
sis_core-1.0.8 lib/json_web_token.rb
sis_core-1.0.7 lib/json_web_token.rb
sis_core-1.0.6 lib/json_web_token.rb