feat: Implement oauth auth code and refresh token flows

This commit is contained in:
Ginger committed 2026-06-29 09:35:48 -04:00
1 parent fb6e5d2838
commit df3f646c92
39 files changed
+1052 -154

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
use axum::{Form, Json, extract::State, response::IntoResponse};
use http::StatusCode;
use service::oauth::grant::TokenRequest;
pub(crate) async fn token_route(
State(services): State<crate::State>,
Form(request): Form<TokenRequest>,
) -> impl IntoResponse {
match services.oauth.issue_token(request).await {
| Ok(response) => Ok(Json(response).into_response()),
| Err(err) => Err((StatusCode::BAD_REQUEST, err.message())),
}
}