Class: HasJwtToken::JwtProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/has_jwt_token/jwt_proxy.rb

Class Method Summary collapse

Class Method Details

.decode!(token:, secret: '', algorithm: '') ⇒ Object



12
13
14
# File 'lib/has_jwt_token/jwt_proxy.rb', line 12

def decode!(token:, secret: '', algorithm: '')
  JWT.decode(token, secret, true, algorithm: algorithm)[0]
end

.encode(payload:, secret: '', algorithm: '', header_fields: {}) ⇒ Object



8
9
10
# File 'lib/has_jwt_token/jwt_proxy.rb', line 8

def encode(payload:, secret: '', algorithm: '', header_fields: {})
  JWT.encode(payload, secret, algorithm, header_fields)
end