mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-29 20:07:32 +00:00
feat: Implement oauth auth code and refresh token flows
This commit is contained in:
39 files changed
+1052
-154
No files matched your search
@@ -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())),
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user