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