From 0ea3cb1d4743b922fbc6e07037096e75caffba8f Mon Sep 17 00:00:00 2001 From: rtkay123 Date: Mon, 2 Feb 2026 22:29:43 +0200 Subject: feat: authorised path --- src/server/routes/auth/mod.rs | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'src/server/routes') 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, data: Data, ) -> Result { + 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, + data: Data, +) -> Result { match params.provider { #[cfg(feature = "oauth-discord")] OauthProvider::Discord => discord::discord_auth(data), - }.await + } + .await } -- cgit v1.2.3