@ -907,36 +907,21 @@ async fn _get_org_details(
Ok ( json ! ( ciphers_json ) )
Ok ( json ! ( ciphers_json ) )
}
}
#[ derive(Deserialize) ]
#[ serde(rename_all = " camelCase " ) ]
struct OrgDomainDetails {
email : String ,
}
// Returning a Domain/Organization here allow to prefill it and prevent prompting the user
// Returning a Domain/Organization here allow to prefill it and prevent prompting the user
// So we either return an Org name associated to the user or a dummy value.
// So we return a dummy value, since we only support a single SSO integration, and do not use the response anywhere
// In use since `v2025.6.0`, appears to use only the first `organizationIdentifier`
// In use since `v2025.6.0`, appears to use only the first `organizationIdentifier`
#[ post( " /organizations/domain/sso/verified " , data = " <data> " ) ]
#[ post( " /organizations/domain/sso/verified " ) ]
async fn get_org_domain_sso_verified ( data : Json < OrgDomainDetails > , conn : DbConn ) -> JsonResult {
fn get_org_domain_sso_verified ( ) -> JsonResult {
let data : OrgDomainDetails = data . into_inner ( ) ;
// Always return a dummy value, no matter if SSO is enabled or not
let identifiers = match Organization ::find_org_user_email ( & data . email , & conn )
. await
. into_iter ( )
. map ( | o | ( o . name , o . uuid . to_string ( ) ) )
. collect ::< Vec < ( String , String ) > > ( )
{
v if ! v . is_empty ( ) = > v ,
_ = > vec ! [ ( FAKE_SSO_IDENTIFIER . to_string ( ) , FAKE_SSO_IDENTIFIER . to_string ( ) ) ] ,
} ;
Ok ( Json ( json ! ( {
Ok ( Json ( json ! ( {
"object" : "list" ,
"object" : "list" ,
"data" : identifiers . into_iter ( ) . map ( | ( name , identifier ) | json ! ( {
"data" : [ {
"organizationName" : name , // appear unused
"organizationIdentifier" : FAKE_SSO_IDENTIFIER ,
"organizationIdentifier" : identifier ,
// These appear to be unused
"domainName" : CONFIG . domain ( ) , // appear unused
"organizationName" : FAKE_SSO_IDENTIFIER ,
} ) ) . collect ::< Vec < Value > > ( )
"domainName" : CONFIG . domain ( )
} ] ,
"continuationToken" : null
} ) ) )
} ) ) )
}
}
@ -3049,10 +3034,7 @@ async fn put_reset_password_enrollment(
err ! ( "User to enroll isn't member of required organization" , "The user_id and acting user do not match" ) ;
err ! ( "User to enroll isn't member of required organization" , "The user_id and acting user do not match" ) ;
}
}
let Some ( mut membership ) = Membership ::find_confirmed_by_user_and_org ( & headers . user . uuid , & org_id , & conn ) . await
let mut membership = headers . membership ;
else {
err ! ( "User to enroll isn't member of required organization" )
} ;
check_reset_password_applicable ( & org_id , & conn ) . await ? ;
check_reset_password_applicable ( & org_id , & conn ) . await ? ;