fix(oauth2): fix spec discrepancies
This commit is contained in:
@@ -24,8 +24,8 @@ auto_derived!(
|
|||||||
#[derive(Copy)]
|
#[derive(Copy)]
|
||||||
#[cfg_attr(feature = "rocket", derive(rocket::FromFormField))]
|
#[cfg_attr(feature = "rocket", derive(rocket::FromFormField))]
|
||||||
pub enum OAuth2GrantType {
|
pub enum OAuth2GrantType {
|
||||||
#[cfg_attr(feature = "rocket", field(value = "code"))]
|
#[cfg_attr(feature = "rocket", field(value = "authorization_code"))]
|
||||||
#[cfg_attr(feature = "serde", serde(rename = "code"))]
|
#[cfg_attr(feature = "serde", serde(rename = "authorization_code"))]
|
||||||
AuthorizationCode,
|
AuthorizationCode,
|
||||||
#[cfg_attr(feature = "rocket", field(value = "implicit"))]
|
#[cfg_attr(feature = "rocket", field(value = "implicit"))]
|
||||||
#[cfg_attr(feature = "serde", serde(rename = "implicit"))]
|
#[cfg_attr(feature = "serde", serde(rename = "implicit"))]
|
||||||
|
|||||||
@@ -12,11 +12,11 @@ use redis_kiss::AsyncCommands;
|
|||||||
///
|
///
|
||||||
/// Generates an OAuth2 code to be passed to the redirect URI.
|
/// Generates an OAuth2 code to be passed to the redirect URI.
|
||||||
#[openapi(tag = "OAuth2")]
|
#[openapi(tag = "OAuth2")]
|
||||||
#[post("/authorize", data="<info>")]
|
#[post("/authorize?<info..>")]
|
||||||
pub async fn auth(
|
pub async fn auth(
|
||||||
db: &State<Database>,
|
db: &State<Database>,
|
||||||
user: User,
|
user: User,
|
||||||
info: Form<v0::OAuth2AuthorizationForm>,
|
info: v0::OAuth2AuthorizationForm,
|
||||||
) -> Result<Json<v0::OAuth2AuthorizeAuthResponse>> {
|
) -> Result<Json<v0::OAuth2AuthorizeAuthResponse>> {
|
||||||
let bot = Reference::from_unchecked(info.client_id.clone())
|
let bot = Reference::from_unchecked(info.client_id.clone())
|
||||||
.as_bot(db)
|
.as_bot(db)
|
||||||
|
|||||||
@@ -85,4 +85,3 @@ pub async fn token(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user