diff options
Diffstat (limited to 'app/controllers/services')
-rw-r--r-- | app/controllers/services/token_generation_service.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/services/token_generation_service.rb b/app/controllers/services/token_generation_service.rb index 2df2ea6..b1bc10a 100644 --- a/app/controllers/services/token_generation_service.rb +++ b/app/controllers/services/token_generation_service.rb @@ -8,6 +8,10 @@ module Services @role = params[:role] end + def call(expiration) + JWT.encode(payload.merge({ exp: expiration.to_i }), ENV['HMAC_SECRET_KEY'], 'HS512') + end + private def payload |