| ... | @@ -249,14 +249,13 @@ async fn exchange( | ... | @@ -249,14 +249,13 @@ async fn exchange( |
| 249 | ) -> Result<(String, String)> { | 249 | ) -> Result<(String, String)> { |
| 250 | let form = [ | 250 | let form = [ |
| 251 | ("client_id", client), | 251 | ("client_id", client), |
| | 252 | ("client_secret", secret), |
| 252 | ("grant_type", "authorization_code"), | 253 | ("grant_type", "authorization_code"), |
| 253 | ("code", code), | 254 | ("code", code), |
| 254 | ("redirect_uri", callback), | 255 | ("redirect_uri", callback), |
| 255 | ("code_verifier", string(&flow["verifier"])), | 256 | ("code_verifier", string(&flow["verifier"])), |
| 256 | ]; | 257 | ]; |
| 257 | if provider == "github" { | 258 | if provider == "github" { |
| 258 | let mut form = form.to_vec(); | | |
| 259 | form.push(("client_secret", secret)); | | |
| 260 | let token = json_bytes( | 259 | let token = json_bytes( |
| 261 | &response_bytes( | 260 | &response_bytes( |
| 262 | http.post("https://github.com/login/oauth/access_token") | 261 | http.post("https://github.com/login/oauth/access_token") |
| ... | @@ -309,7 +308,6 @@ async fn exchange( | ... | @@ -309,7 +308,6 @@ async fn exchange( |
| 309 | let token = json_bytes( | 308 | let token = json_bytes( |
| 310 | &response_bytes( | 309 | &response_bytes( |
| 311 | http.post(format!("{ASTHENO}/api/token")) | 310 | http.post(format!("{ASTHENO}/api/token")) |
| 312 | .basic_auth(client, Some(secret)) | | |
| 313 | .form(&form) | 311 | .form(&form) |
| 314 | .send() | 312 | .send() |
| 315 | .await?, | 313 | .await?, |