diff --git a/src/database/models/oauth_client_item.rs b/src/database/models/oauth_client_item.rs index eb9bf5ce..c2abbea7 100644 --- a/src/database/models/oauth_client_item.rs +++ b/src/database/models/oauth_client_item.rs @@ -161,12 +161,14 @@ impl OAuthClient { sqlx::query!( " UPDATE oauth_clients - SET name = $1, icon_url = $2, max_scopes = $3 - WHERE (id = $4) + SET name = $1, icon_url = $2, max_scopes = $3, url = $4, description = $5 + WHERE (id = $6) ", self.name, self.icon_url, self.max_scopes.to_postgres(), + self.url, + self.description, self.id.0, ) .execute(exec) diff --git a/src/routes/v3/oauth_clients.rs b/src/routes/v3/oauth_clients.rs index c530b62a..881cd040 100644 --- a/src/routes/v3/oauth_clients.rs +++ b/src/routes/v3/oauth_clients.rs @@ -150,7 +150,10 @@ pub struct NewOAuthApp { pub redirect_uris: Vec, - #[validate(custom(function = "crate::util::validate::validate_url"))] + #[validate( + custom(function = "crate::util::validate::validate_url"), + length(max = 255) + )] pub url: Option, #[validate(length(max = 255))] @@ -261,7 +264,10 @@ pub struct OAuthClientEdit { #[validate(length(min = 1))] pub redirect_uris: Option>, - #[validate(custom(function = "crate::util::validate::validate_url"))] + #[validate( + custom(function = "crate::util::validate::validate_url"), + length(max = 255) + )] pub url: Option>, #[validate(length(max = 255))]