summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormrw1593 <botahamec@outlook.com>2023-05-29 17:18:39 -0400
committermrw1593 <botahamec@outlook.com>2023-05-29 17:18:39 -0400
commitf1a64b059d430cd2e334e297c43ae8053104ab05 (patch)
tree16d6d62d8157aa692d6b8e06fde7739a86579071 /src
parent4782cd0c9f1b930f05fe24118001a4de45893b79 (diff)
Optional authorization
Diffstat (limited to 'src')
-rw-r--r--src/api/oauth.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/api/oauth.rs b/src/api/oauth.rs
index a563ac8..d77695e 100644
--- a/src/api/oauth.rs
+++ b/src/api/oauth.rs
@@ -67,14 +67,16 @@ struct TokenRequest {
#[serde(flatten)]
grant_type: GrantType,
scope: String, // TODO lol no
+ // TODO support optional client credentials in here
}
#[post("/token")]
async fn token(
db: web::Data<MySqlPool>,
req: web::Form<TokenRequest>,
- authorization: web::Header<authorization::BasicAuthorization>, // TODO make this optional
+ authorization: Option<web::Header<authorization::BasicAuthorization>>,
) -> HttpResponse {
+ // TODO protect against brute force attacks
todo!()
}