about summary refs log tree commit diff
path: root/app/controllers/auth/omniauth_callbacks_controller.rb
diff options
context:
space:
mode:
authorStarfall <us@starfall.systems>2021-07-07 11:46:33 -0500
committerStarfall <us@starfall.systems>2021-07-07 11:46:33 -0500
commitd30025d28d813999bfe98ce9cee2cda3bebf6c22 (patch)
treee2cf70344fc6426f3a2c778d3b6d3bab9e22c078 /app/controllers/auth/omniauth_callbacks_controller.rb
parentfadb06ef6e1950a82f08673683e705943b93ba40 (diff)
parent0c2eb949fc21ceecbd99a81e5ffe75517a1e64df (diff)
Merge branch 'glitch'
Diffstat (limited to 'app/controllers/auth/omniauth_callbacks_controller.rb')
-rw-r--r--app/controllers/auth/omniauth_callbacks_controller.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/controllers/auth/omniauth_callbacks_controller.rb b/app/controllers/auth/omniauth_callbacks_controller.rb
index 682c77016..7925e23cb 100644
--- a/app/controllers/auth/omniauth_callbacks_controller.rb
+++ b/app/controllers/auth/omniauth_callbacks_controller.rb
@@ -10,6 +10,15 @@ class Auth::OmniauthCallbacksController < Devise::OmniauthCallbacksController
       @user = User.find_for_oauth(request.env['omniauth.auth'], current_user)
 
       if @user.persisted?
+        LoginActivity.create(
+          user: user,
+          success: true,
+          authentication_method: :omniauth,
+          provider: provider,
+          ip: request.remote_ip,
+          user_agent: request.user_agent
+        )
+
         sign_in_and_redirect @user, event: :authentication
         set_flash_message(:notice, :success, kind: provider_id.capitalize) if is_navigational_format?
       else