mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 00:41:16 +08:00
FIX: store registration ip address when creating user via SSO (#26121)
This commit is contained in:
@ -694,6 +694,26 @@ RSpec.describe DiscourseConnect do
|
||||
expect(user.username).to eq short_username
|
||||
end
|
||||
|
||||
it "stores registration ip address if it's present" do
|
||||
sso = new_discourse_sso
|
||||
sso.external_id = "100"
|
||||
|
||||
sso.email = "mail@mail.com"
|
||||
user = sso.lookup_or_create_user(ip_address)
|
||||
|
||||
expect(user.registration_ip_address).to eq ip_address
|
||||
end
|
||||
|
||||
it "does not store registration ip address if it's not present" do
|
||||
sso = new_discourse_sso
|
||||
sso.external_id = "100"
|
||||
|
||||
sso.email = "mail@mail.com"
|
||||
user = sso.lookup_or_create_user(nil)
|
||||
|
||||
expect(user.registration_ip_address).to eq nil
|
||||
end
|
||||
|
||||
it "can fill in data on way back" do
|
||||
sso = make_sso
|
||||
|
||||
|
Reference in New Issue
Block a user