mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 02:27:17 +08:00
FIX: skip email if blank while syncing SSO attributes. (#19939)
Also, return email blank error in `EmailValidator` when the email is blank.
This commit is contained in:
@ -1777,6 +1777,26 @@ RSpec.describe Admin::UsersController do
|
||||
expect(user.username).to eq("Hokli")
|
||||
end
|
||||
|
||||
it "can sync up with the sso without email" do
|
||||
sso.name = "Bob The Bob"
|
||||
sso.username = "bob"
|
||||
sso.email = "bob@bob.com"
|
||||
sso.external_id = "1"
|
||||
|
||||
user =
|
||||
DiscourseConnect.parse(
|
||||
sso.payload,
|
||||
secure_session: read_secure_session,
|
||||
).lookup_or_create_user
|
||||
|
||||
sso.name = "Bill"
|
||||
sso.username = "Hokli$$!!"
|
||||
sso.email = nil
|
||||
|
||||
post "/admin/users/sync_sso.json", params: Rack::Utils.parse_query(sso.payload)
|
||||
expect(response.status).to eq(200)
|
||||
end
|
||||
|
||||
it "should create new users" do
|
||||
sso.name = "Dr. Claw"
|
||||
sso.username = "dr_claw"
|
||||
|
Reference in New Issue
Block a user