mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
REVERT: External auth when redeeming invites
Reverting this commit: 87a0a6664e4bcde2ec3ac012308d9c7fb8e0d370 because I'm extracting all of this logic into a plugin instead.
This commit is contained in:
@ -108,7 +108,7 @@ class Users::OmniauthCallbacksController < ApplicationController
|
||||
def complete_response_data
|
||||
if @auth_result.user
|
||||
user_found(@auth_result.user)
|
||||
elsif invite_required?
|
||||
elsif SiteSetting.invite_only?
|
||||
@auth_result.requires_invite = true
|
||||
else
|
||||
session[:authentication] = @auth_result.session_data
|
||||
@ -156,10 +156,4 @@ class Users::OmniauthCallbacksController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
# If invite_only and enable_invite_only_oauth allow the user to authenticate if coming from the invite page
|
||||
def invite_required?
|
||||
(SiteSetting.invite_only? && !SiteSetting.enable_invite_only_oauth) ||
|
||||
(SiteSetting.invite_only? && (!@origin.include?('invites') && SiteSetting.enable_invite_only_oauth))
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user