aboutsummaryrefslogtreecommitdiffstats
path: root/src/server/routes/auth
diff options
context:
space:
mode:
authorrtkay123 <dev@kanjala.com>2026-02-02 22:29:43 +0200
committerrtkay123 <dev@kanjala.com>2026-02-02 22:29:43 +0200
commit0ea3cb1d4743b922fbc6e07037096e75caffba8f (patch)
tree22581bb5b3438bcf98a9be1c53646fb09c7aec4f /src/server/routes/auth
parentcdcf6a4caa66095c07ef9d6d3ebc7c795a046e1e (diff)
downloadsellershut-0ea3cb1d4743b922fbc6e07037096e75caffba8f.tar.bz2
sellershut-0ea3cb1d4743b922fbc6e07037096e75caffba8f.zip
feat: authorised path
Diffstat (limited to 'src/server/routes/auth')
-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
}