diff options
| author | rtkay123 <dev@kanjala.com> | 2026-02-02 22:29:43 +0200 |
|---|---|---|
| committer | rtkay123 <dev@kanjala.com> | 2026-02-02 22:29:43 +0200 |
| commit | 0ea3cb1d4743b922fbc6e07037096e75caffba8f (patch) | |
| tree | 22581bb5b3438bcf98a9be1c53646fb09c7aec4f /src/server/routes/auth/mod.rs | |
| parent | cdcf6a4caa66095c07ef9d6d3ebc7c795a046e1e (diff) | |
| download | sellershut-0ea3cb1d4743b922fbc6e07037096e75caffba8f.tar.bz2 sellershut-0ea3cb1d4743b922fbc6e07037096e75caffba8f.zip | |
feat: authorised path
Diffstat (limited to 'src/server/routes/auth/mod.rs')
| -rw-r--r-- | src/server/routes/auth/mod.rs | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/server/routes/auth/mod.rs b/src/server/routes/auth/mod.rs index f0da7cd..485983a 100644 --- a/src/server/routes/auth/mod.rs +++ b/src/server/routes/auth/mod.rs @@ -55,9 +55,33 @@ pub async fn auth( Query(params): Query<Params>, data: Data<AppState>, ) -> Result<impl IntoResponse, AppError> { + match params.provider { + #[cfg(feature = "oauth-discord")] + OauthProvider::Discord => discord::discord_auth(data), + } + .await +} +#[utoipa::path( + method(get), + path = "/auth/authorised", + params( + Params + ), + tag = AUTH, + responses( + (status = OK, description = "Auth redirect url", body = str, content_type = "text/plain") + ) +)] +#[axum::debug_handler] +#[cfg(feature = "oauth")] +pub async fn authorised( + Query(params): Query<Params>, + data: Data<AppState>, +) -> Result<impl IntoResponse, AppError> { match params.provider { #[cfg(feature = "oauth-discord")] OauthProvider::Discord => discord::discord_auth(data), - }.await + } + .await } |
