Skip to content

Commit 6481ae6

Browse files
authored
Fix upstream OAuth 2.0 callbacks using the form_post method (#4057)
2 parents 16fd556 + ca63e0b commit 6481ae6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

crates/handlers/src/upstream_oauth2/callback.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,22 @@ use crate::{impl_from_error_for_route, upstream_oauth2::cache::MetadataCache, Pr
4141

4242
#[derive(Serialize, Deserialize)]
4343
pub struct Params {
44+
#[serde(skip_serializing_if = "Option::is_none")]
4445
state: Option<String>,
4546

4647
/// An extra parameter to track whether the POST request was re-made by us
4748
/// to the same URL to escape Same-Site cookies restrictions
4849
#[serde(default)]
4950
did_mas_repost_to_itself: bool,
5051

52+
#[serde(skip_serializing_if = "Option::is_none")]
5153
code: Option<String>,
5254

55+
#[serde(skip_serializing_if = "Option::is_none")]
5356
error: Option<ClientErrorCode>,
57+
#[serde(skip_serializing_if = "Option::is_none")]
5458
error_description: Option<String>,
55-
#[allow(dead_code)]
59+
#[serde(skip_serializing_if = "Option::is_none")]
5660
error_uri: Option<String>,
5761

5862
#[serde(flatten)]

0 commit comments

Comments
 (0)