diff options
author | HombreLaser <sebastian-440@live.com> | 2023-02-23 18:51:51 -0600 |
---|---|---|
committer | HombreLaser <sebastian-440@live.com> | 2023-02-23 18:51:51 -0600 |
commit | 91a11ca69d372b8b93b4b56ff716d8578a86500e (patch) | |
tree | 5f31570567bb93a251ad9390932b47d33efe5948 /app/controllers/services/token_generation_service.rb | |
parent | f7a0fb572e4518146ec9cb29669d12cd22b4dc11 (diff) |
Arregla la autenticación
Diffstat (limited to 'app/controllers/services/token_generation_service.rb')
-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 |