diff options
author | Claire <claire.github-309c@sitedethib.com> | 2021-06-23 12:49:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-23 12:49:09 +0200 |
commit | 776e00f19399875a135a64d8ad486f3578101cf9 (patch) | |
tree | ea846e21767b1cb2f9f277d3829fbade1f0e46a0 /app/controllers/auth/omniauth_callbacks_controller.rb | |
parent | a434f370f38ac66e05000545e36d7c696f4962d0 (diff) | |
parent | 979059fbc93664b38b720b369b31beaa89457879 (diff) |
Merge pull request #1551 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/controllers/auth/omniauth_callbacks_controller.rb')
-rw-r--r-- | app/controllers/auth/omniauth_callbacks_controller.rb | 9 |
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 |