diff options
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) } |
