diff --git a/crates/core/models/src/v0/oauth2.rs b/crates/core/models/src/v0/oauth2.rs index 9bc5aacb..73525439 100644 --- a/crates/core/models/src/v0/oauth2.rs +++ b/crates/core/models/src/v0/oauth2.rs @@ -24,8 +24,8 @@ auto_derived!( #[derive(Copy)] #[cfg_attr(feature = "rocket", derive(rocket::FromFormField))] pub enum OAuth2GrantType { - #[cfg_attr(feature = "rocket", field(value = "code"))] - #[cfg_attr(feature = "serde", serde(rename = "code"))] + #[cfg_attr(feature = "rocket", field(value = "authorization_code"))] + #[cfg_attr(feature = "serde", serde(rename = "authorization_code"))] AuthorizationCode, #[cfg_attr(feature = "rocket", field(value = "implicit"))] #[cfg_attr(feature = "serde", serde(rename = "implicit"))] diff --git a/crates/delta/src/routes/oauth2/authorize_auth.rs b/crates/delta/src/routes/oauth2/authorize_auth.rs index 68d94baa..2f149a83 100644 --- a/crates/delta/src/routes/oauth2/authorize_auth.rs +++ b/crates/delta/src/routes/oauth2/authorize_auth.rs @@ -12,11 +12,11 @@ use redis_kiss::AsyncCommands; /// /// Generates an OAuth2 code to be passed to the redirect URI. #[openapi(tag = "OAuth2")] -#[post("/authorize", data="")] +#[post("/authorize?")] pub async fn auth( db: &State, user: User, - info: Form, + info: v0::OAuth2AuthorizationForm, ) -> Result> { let bot = Reference::from_unchecked(info.client_id.clone()) .as_bot(db) diff --git a/crates/delta/src/routes/oauth2/token.rs b/crates/delta/src/routes/oauth2/token.rs index 9dffbcbe..84456ff0 100644 --- a/crates/delta/src/routes/oauth2/token.rs +++ b/crates/delta/src/routes/oauth2/token.rs @@ -85,4 +85,3 @@ pub async fn token( } } } - \ No newline at end of file