refactor(oauth): Allow to use any registration method with OAuth::login

Gets rid of OAuth::url_for_oidc since it can be replaced by a call to
OAuth::login now.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
This commit is contained in:
Kévin Commaille
2025-03-21 03:36:26 +01:00
committed by Ivan Enderlin
parent 7457ecb1a8
commit a8aa364757
6 changed files with 72 additions and 71 deletions
+3 -3
View File
@@ -24,8 +24,8 @@ use futures_util::StreamExt;
use matrix_sdk::{
authentication::oauth::{
registration::{ApplicationType, ClientMetadata, Localized, OAuthGrantType},
AccountManagementActionFull, AuthorizationCode, AuthorizationResponse, ClientId, CsrfToken,
OAuthAuthorizationData, OAuthSession, UserSession,
AccountManagementActionFull, AuthorizationCode, AuthorizationResponse, ClientId,
ClientRegistrationMethod, CsrfToken, OAuthAuthorizationData, OAuthSession, UserSession,
},
config::SyncSettings,
encryption::{recovery::RecoveryState, CrossSigningResetAuthType},
@@ -219,7 +219,7 @@ impl OidcCli {
let (redirect_uri, server_handle) = LocalServerBuilder::new().spawn().await?;
let OAuthAuthorizationData { url, state } =
oauth.login(redirect_uri, None).build().await?;
oauth.login(ClientRegistrationMethod::None, redirect_uri, None).build().await?;
let authorization_code = match use_auth_url(&url, &state, server_handle).await {
Ok(code) => code,