Class: Morpho::JWT::Payload
- Inherits:
-
Object
- Object
- Morpho::JWT::Payload
- Defined in:
- app/services/morpho/jwt/payload.rb
Class Method Summary collapse
Class Method Details
.new(user) ⇒ Object
4 5 6 7 8 9 10 |
# File 'app/services/morpho/jwt/payload.rb', line 4 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 |