diff options
author | HombreLaser <sebastian-440@live.com> | 2023-02-24 21:28:48 -0600 |
---|---|---|
committer | HombreLaser <sebastian-440@live.com> | 2023-02-24 21:28:48 -0600 |
commit | 53c55cbf14899d83023cf2e9b11ed204e7b630d3 (patch) | |
tree | 2569f0dd19b7b75c1d35ce700c43778c7fcde5b4 /app/controllers/api/authentications_controller | |
parent | 81ad272e12d75d0268163ec5881b47d24affa540 (diff) |
Refactoriza create_logic
Diffstat (limited to 'app/controllers/api/authentications_controller')
-rw-r--r-- | app/controllers/api/authentications_controller/create_logic.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/controllers/api/authentications_controller/create_logic.rb b/app/controllers/api/authentications_controller/create_logic.rb index e3af94d..743eed9 100644 --- a/app/controllers/api/authentications_controller/create_logic.rb +++ b/app/controllers/api/authentications_controller/create_logic.rb @@ -11,9 +11,10 @@ module Api end def call - jwt = { token: service.call(DateTime.now + 30.minutes), refresh: service.call(DateTime.now + 3.days) } + return unless @user_account&.authenticate(@password) - return jwt if @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) } end private |