Browse Source

Fix Org identifier (#6364)

* Fix Org identifier

* Org invitation default to SSO when SSO_ENABLED
pull/6158/merge
Timshel 1 week ago
committed by GitHub
parent
commit
8043f7eca7
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 8
      src/api/core/organizations.rs
  2. 4
      src/mail.rs

8
src/api/core/organizations.rs

@ -355,9 +355,11 @@ async fn get_auto_enroll_status(identifier: &str, headers: Headers, mut conn: Db
let (id, identifier, rp_auto_enroll) = match org { let (id, identifier, rp_auto_enroll) = match org {
None => (get_uuid(), identifier.to_string(), false), None => (get_uuid(), identifier.to_string(), false),
Some(org) => { Some(org) => (
(org.uuid.to_string(), org.name, OrgPolicy::org_is_reset_password_auto_enroll(&org.uuid, &mut conn).await) org.uuid.to_string(),
} org.uuid.to_string(),
OrgPolicy::org_is_reset_password_auto_enroll(&org.uuid, &mut conn).await,
),
}; };
Ok(Json(json!({ Ok(Json(json!({

4
src/mail.rs

@ -302,9 +302,9 @@ pub async fn send_invite(
.append_pair("organizationUserId", &member_id) .append_pair("organizationUserId", &member_id)
.append_pair("token", &invite_token); .append_pair("token", &invite_token);
if CONFIG.sso_enabled() && CONFIG.sso_only() { if CONFIG.sso_enabled() {
query_params.append_pair("orgUserHasExistingUser", "false"); query_params.append_pair("orgUserHasExistingUser", "false");
query_params.append_pair("orgSsoIdentifier", org_name); query_params.append_pair("orgSsoIdentifier", &org_id);
} else if user.private_key.is_some() { } else if user.private_key.is_some() {
query_params.append_pair("orgUserHasExistingUser", "true"); query_params.append_pair("orgUserHasExistingUser", "true");
} }

Loading…
Cancel
Save