A library for ATProtocol identities.

bug: login_hint always sent in oauth init

Signed-off-by: Nick Gerakines <nick.gerakines@gmail.com>

Changed files
+7 -5
crates
atproto-oauth
atproto-oauth-aip
+2 -2
crates/atproto-oauth-aip/src/workflow.rs
··· 255 255 pub async fn oauth_init( 256 256 http_client: &reqwest::Client, 257 257 oauth_client: &OAuthClient, 258 - handle: Option<&str>, 258 + login_hint: Option<&str>, 259 259 authorization_server: &AuthorizationServer, 260 260 oauth_request_state: &OAuthRequestState, 261 261 ) -> Result<ParResponse> { ··· 274 274 ("scope", scope), 275 275 ("state", oauth_request_state.state.as_str()), 276 276 ]; 277 - if let Some(value) = handle { 277 + if let Some(value) = login_hint { 278 278 params.push(("login_hint", value)); 279 279 } 280 280
+5 -3
crates/atproto-oauth/src/workflow.rs
··· 259 259 http_client: &reqwest::Client, 260 260 oauth_client: &OAuthClient, 261 261 dpop_key_data: &KeyData, 262 - handle: &str, 262 + login_hint: Option<&str>, 263 263 authorization_server: &AuthorizationServer, 264 264 oauth_request_state: &OAuthRequestState, 265 265 ) -> Result<ParResponse, OAuthClientError> { ··· 299 299 .with(ChainMiddleware::new(dpop_retry.clone())) 300 300 .build(); 301 301 302 - let params = [ 302 + let mut params = vec![ 303 303 ("response_type", "code"), 304 304 ("code_challenge", &oauth_request_state.code_challenge), 305 305 ("code_challenge_method", "S256"), ··· 307 307 ("state", oauth_request_state.state.as_str()), 308 308 ("redirect_uri", oauth_client.redirect_uri.as_str()), 309 309 ("scope", scope), 310 - ("login_hint", handle), 311 310 ( 312 311 "client_assertion_type", 313 312 "urn:ietf:params:oauth:client-assertion-type:jwt-bearer", 314 313 ), 315 314 ("client_assertion", client_assertion_token.as_str()), 316 315 ]; 316 + if let Some(value) = login_hint { 317 + params.push(("login_hint", value)); 318 + } 317 319 318 320 let response = dpop_retry_client 319 321 .post(par_url)