summaryrefslogtreecommitdiff
path: root/app/controllers/api/authentications_controller
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/api/authentications_controller')
-rw-r--r--app/controllers/api/authentications_controller/create_logic.rb5
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