Class: JWT::Payload
- Inherits:
-
Object
- Object
- JWT::Payload
- Defined in:
- app/services/morpho/jwt/payload.rb
Class Method Summary collapse
Class Method Details
.new(user) ⇒ Object
3 4 5 6 7 8 9 |
# File 'app/services/morpho/jwt/payload.rb', line 3 def self.new(user) expires_at = Time.now.to_i + Morpho.config.jwt.expiration_time issued_at = Time.now.to_i token = Morpho::JWT::Encode.new({ exp: expires_at, iat: issued_at, email: user.email }) { authentication_token: token, expires_at: expires_at, refresh_token: user.refresh_token } end |