Class: HasJwtToken::JwtProxy
- Inherits:
-
Object
- Object
- HasJwtToken::JwtProxy
- Defined in:
- lib/has_jwt_token/jwt_proxy.rb
Class Method Summary collapse
- .decode!(token:, secret: '', algorithm: '') ⇒ Object
- .encode(payload:, secret: '', algorithm: '', header_fields: {}) ⇒ Object
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 |