diff options
| author | rtkay123 <dev@kanjala.com> | 2026-02-03 13:45:46 +0200 |
|---|---|---|
| committer | rtkay123 <dev@kanjala.com> | 2026-02-03 13:45:46 +0200 |
| commit | eb2e86997d47249aa31b703598de13ab2eb96caa (patch) | |
| tree | 9a591adee7d027b305d07a04987b5559b99f4d37 /src/server/routes/auth | |
| parent | 0ea3cb1d4743b922fbc6e07037096e75caffba8f (diff) | |
| download | sellershut-master.tar.bz2 sellershut-master.zip | |
Diffstat (limited to 'src/server/routes/auth')
| -rw-r--r-- | src/server/routes/auth/mod.rs | 17 |
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) } |
