1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-29 22:01:14 +03:00

Merge data structs and use builder pattern

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
This commit is contained in:
Kévin Commaille
2023-08-08 12:25:35 +02:00
committed by Quentin Gliech
parent c67a00ddd6
commit ba4ba75f73
3 changed files with 116 additions and 57 deletions

View File

@ -86,18 +86,17 @@ pub(crate) async fn get(
let redirect_uri = url_builder.upstream_oauth_callback(provider.id);
let data = AuthorizationRequestData {
client_id: &provider.client_id,
scope: &provider.scope,
redirect_uri: &redirect_uri,
code_challenge_methods_supported: metadata.code_challenge_methods_supported.as_deref(),
};
let data = AuthorizationRequestData::new(
provider.client_id.clone(),
provider.scope.clone(),
redirect_uri,
);
// Build an authorization request for it
let (url, data) = mas_oidc_client::requests::authorization_code::build_authorization_url(
metadata.authorization_endpoint().clone(),
data,
None,
metadata.code_challenge_methods_supported.as_deref(),
&mut rng,
)?;