From eb2e86997d47249aa31b703598de13ab2eb96caa Mon Sep 17 00:00:00 2001 From: rtkay123 Date: Tue, 3 Feb 2026 13:45:46 +0200 Subject: feat: add cache --- src/server/routes/auth/mod.rs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/server/routes/auth') diff --git a/src/server/routes/auth/mod.rs b/src/server/routes/auth/mod.rs index 485983a..7d7ecf3 100644 --- a/src/server/routes/auth/mod.rs +++ b/src/server/routes/auth/mod.rs @@ -55,11 +55,14 @@ pub async fn auth( Query(params): Query, data: Data, ) -> Result { - match params.provider { - #[cfg(feature = "oauth-discord")] + #[cfg(feature = "oauth-discord")] + return match params.provider { OauthProvider::Discord => discord::discord_auth(data), } - .await + .await; + + #[cfg(not(feature = "oauth-discord"))] + Ok(axum::http::StatusCode::INTERNAL_SERVER_ERROR) } #[utoipa::path( @@ -79,9 +82,13 @@ pub async fn authorised( Query(params): Query, data: Data, ) -> Result { - match params.provider { + #[cfg(feature = "oauth-discord")] + return match params.provider { #[cfg(feature = "oauth-discord")] OauthProvider::Discord => discord::discord_auth(data), } - .await + .await; + + #[cfg(not(feature = "oauth-discord"))] + Ok(axum::http::StatusCode::INTERNAL_SERVER_ERROR) } -- cgit v1.2.3