FEATURE: sso_overrides_(email|username|name) for all auth methods

These settings previously applied only to discourse-sso. Now they work for all external authentication methods.
This commit is contained in:
David Taylor
2020-06-18 11:01:02 +01:00
parent ec448a1516
commit 977766e7a8
14 changed files with 143 additions and 60 deletions

View File

@ -137,6 +137,7 @@ class Users::OmniauthCallbacksController < ApplicationController
elsif ScreenedIpAddress.block_admin_login?(user, request.remote_ip)
@auth_result.admin_not_allowed_from_ip_address = true
elsif Guardian.new(user).can_access_forum? && user.active # log on any account that is active with forum access
user.save! if @auth_result.apply_user_attributes!
log_on_user(user)
Invite.invalidate_for_email(user.email) # invite link can't be used to log in anymore
session[:authentication] = nil # don't carry around old auth info, perhaps move elsewhere