Skip to content

Commit 2b85735

Browse files
committed
fix(bindings): PR comments.
1 parent 9026dbc commit 2b85735

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

bindings/matrix-sdk-ffi/src/authentication_service.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,7 @@ impl AuthenticationService {
365365
if provider_metadata
366366
.prompt_values_supported
367367
.as_ref()
368-
.map(|p| p.contains(&Prompt::Consent))
369-
.unwrap_or(false)
368+
.is_some_and(|p| p.contains(&Prompt::Consent))
370369
{
371370
data_builder = data_builder.prompt(vec![Prompt::Consent]);
372371
}
@@ -472,7 +471,8 @@ impl AuthenticationService {
472471

473472
let oidc_metadata = self.oidc_metadata(configuration)?;
474473

475-
if self.load_client_registration(oidc, oidc_metadata.clone()).await {
474+
if self.load_client_registration(oidc, &authentication_server, oidc_metadata.clone()).await
475+
{
476476
tracing::info!("OIDC configuration loaded from disk.");
477477
return Ok(());
478478
}
@@ -527,11 +527,10 @@ impl AuthenticationService {
527527
async fn load_client_registration(
528528
&self,
529529
oidc: &Oidc,
530+
authentication_server: &AuthenticationServerInfo,
530531
oidc_metadata: VerifiedClientMetadata,
531532
) -> bool {
532-
let Some(issuer) = oidc.issuer() else {
533-
return false;
534-
};
533+
let issuer = &authentication_server.issuer;
535534
let Some(registrations) = OidcRegistrations::new(
536535
&self.base_path,
537536
self.oidc_configuration
@@ -551,11 +550,7 @@ impl AuthenticationService {
551550
metadata: oidc_metadata,
552551
};
553552

554-
let authentication_server = AuthenticationServerInfo::new(
555-
issuer.to_owned(),
556-
oidc.account_management_url().unwrap_or(None).map(|url| url.to_string()),
557-
);
558-
oidc.restore_registered_client(authentication_server, client_data).await;
553+
oidc.restore_registered_client(authentication_server.clone(), client_data).await;
559554

560555
true
561556
}

0 commit comments

Comments
 (0)