mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: restrict admin access based on IP address
This commit is contained in:
@@ -81,8 +81,9 @@ class Users::OmniauthCallbacksController < ApplicationController
|
||||
user.toggle(:active).save
|
||||
end
|
||||
|
||||
# log on any account that is active with forum access
|
||||
if Guardian.new(user).can_access_forum? && user.active
|
||||
if ScreenedIpAddress.block_login?(user, request.remote_ip)
|
||||
@data.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
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user