From 91a11ca69d372b8b93b4b56ff716d8578a86500e Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Thu, 23 Feb 2023 18:51:51 -0600 Subject: Arregla la autenticación MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/services/token_generation_service.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/controllers/services/token_generation_service.rb') 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 -- cgit v1.2.3