diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb index 7b0bff2b9..dcaa55ca1 100644 --- a/app/controllers/users/omniauth_callbacks_controller.rb +++ b/app/controllers/users/omniauth_callbacks_controller.rb @@ -58,6 +58,8 @@ module Users reason: I18n.t('devise.linkedin.failed_to_save')) redirect_to after_omniauth_failure_path_for(resource_name) and return end + # Confirm user + @user.update_column(:confirmed_at, @user.created_at) redirect_to users_sign_up_provider_path(user: @user) end end diff --git a/app/models/user.rb b/app/models/user.rb index 0627847f5..f6ab10aa3 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -209,7 +209,7 @@ class User < ApplicationRecord has_many :user_notifications, inverse_of: :user has_many :notifications, through: :user_notifications - has_many :user_system_notifications + has_many :user_system_notifications, dependent: :destroy has_many :system_notifications, through: :user_system_notifications has_many :zip_exports, inverse_of: :user, dependent: :destroy has_many :datatables_teams, class_name: '::Views::Datatables::DatatablesTeam'