aboutsummaryrefslogtreecommitdiffstats
path: root/src/server/routes/auth/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/routes/auth/mod.rs')
-rw-r--r--src/server/routes/auth/mod.rs26
1 files changed, 25 insertions, 1 deletions
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<Params>,
data: Data<AppState>,
) -> Result<impl IntoResponse, AppError> {
+ 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<Params>,
+ data: Data<AppState>,
+) -> Result<impl IntoResponse, AppError> {
match params.provider {
#[cfg(feature = "oauth-discord")]
OauthProvider::Discord => discord::discord_auth(data),
- }.await
+ }
+ .await
}