mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: SSO code should respect IP address filters
This commit is contained in:
@ -66,7 +66,8 @@ class SessionController < ApplicationController
|
||||
sso.expire_nonce!
|
||||
|
||||
begin
|
||||
if user = sso.lookup_or_create_user
|
||||
if user = sso.lookup_or_create_user(request.remote_ip)
|
||||
|
||||
if SiteSetting.must_approve_users? && !user.approved?
|
||||
render text: I18n.t("sso.account_not_approved"), status: 403
|
||||
else
|
||||
@ -145,8 +146,7 @@ class SessionController < ApplicationController
|
||||
end
|
||||
|
||||
if ScreenedIpAddress.block_login?(user, request.remote_ip)
|
||||
not_allowed_from_ip_address(user)
|
||||
return
|
||||
return not_allowed_from_ip_address(user)
|
||||
end
|
||||
|
||||
(user.active && user.email_confirmed?) ? login(user) : not_activated(user)
|
||||
|
Reference in New Issue
Block a user