Class: Care::JwtService
- Inherits:
-
Object
- Object
- Care::JwtService
- Defined in:
- lib/care/jwt_service.rb
Instance Method Summary collapse
Instance Method Details
#decode(token) ⇒ Object
3 4 5 6 |
# File 'lib/care/jwt_service.rb', line 3 def decode(token) decoded_token = JWT.decode(token, public_key, true, algorithm: 'RS256') HashWithIndifferentAccess.new(decoded_token[0]) end |
#encode(payload) ⇒ Object
8 9 10 |
# File 'lib/care/jwt_service.rb', line 8 def encode(payload) JWT.encode(payload, secret_key, 'RS256') end |