aboutsummaryrefslogtreecommitdiffstats
path: root/src/server/routes/auth/mod.rs
diff options
context:
space:
mode:
authorrtkay123 <dev@kanjala.com>2026-02-03 13:45:46 +0200
committerrtkay123 <dev@kanjala.com>2026-02-03 13:45:46 +0200
commiteb2e86997d47249aa31b703598de13ab2eb96caa (patch)
tree9a591adee7d027b305d07a04987b5559b99f4d37 /src/server/routes/auth/mod.rs
parent0ea3cb1d4743b922fbc6e07037096e75caffba8f (diff)
downloadsellershut-master.tar.bz2
sellershut-master.zip
feat: add cacheHEADmaster
Diffstat (limited to 'src/server/routes/auth/mod.rs')
-rw-r--r--src/server/routes/auth/mod.rs17
1 files changed, 12 insertions, 5 deletions
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<Params>,
data: Data<AppState>,
) -> Result<impl IntoResponse, AppError> {
- 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<Params>,
data: Data<AppState>,
) -> Result<impl IntoResponse, AppError> {
- 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)
}