From e1a240c563b0e10e0ceae7c167fdcde752f3d865 Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Fri, 24 Feb 2023 23:25:26 -0600 Subject: AƱade autenticaciĆ³n MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/authentications_controller/create_logic.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app/controllers/api') diff --git a/app/controllers/api/authentications_controller/create_logic.rb b/app/controllers/api/authentications_controller/create_logic.rb index 743eed9..c62c300 100644 --- a/app/controllers/api/authentications_controller/create_logic.rb +++ b/app/controllers/api/authentications_controller/create_logic.rb @@ -14,7 +14,8 @@ module Api return unless @user_account&.authenticate(@password) @user_account.session_key = SecureRandom.hex(16) - jwt = { token: service.call(DateTime.now + 30.minutes), refresh: service.call(DateTime.now + 3.days) } + @user_account.save + { token: service.call(DateTime.current + 30.minutes), refresh: service.call(DateTime.current + 3.days) } end private @@ -24,7 +25,7 @@ module Api end def service_params - { email: @email, role: @user_account.role } + { email: @email, role: @user_account.role, session_key: @user_account.session_key } end end end -- cgit v1.2.3