From 549d98f3b457ddfc6dffbe2fad406da4ac50ebc7 Mon Sep 17 00:00:00 2001 From: rtkay123 Date: Mon, 2 Feb 2026 13:30:25 +0200 Subject: refactor: collapse auth --- src/server/routes/auth/discord.rs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'src/server/routes/auth') diff --git a/src/server/routes/auth/discord.rs b/src/server/routes/auth/discord.rs index 036a35a..b141ce7 100644 --- a/src/server/routes/auth/discord.rs +++ b/src/server/routes/auth/discord.rs @@ -1,11 +1,17 @@ -use std::sync::Arc; +use activitypub_federation::config::Data; +use axum::response::IntoResponse; +use oauth2::{CsrfToken, Scope}; -use axum::{extract::State, response::IntoResponse}; +use crate::server::{error::AppError, state::AppState}; -use crate::server::{driver::SellershutDriver, error::AppError}; +pub(super) async fn discord_auth(data: Data) -> Result { + let data = data.app_data(); -async fn auth( - State(client): State>, -) -> Result { - Ok(()) + let (auth_url, csrf_token) = data + .oauth_discord + .authorize_url(CsrfToken::new_random) + .add_scope(Scope::new("identify".to_string())) + .url(); + + Ok(String::default()) } -- cgit v1.2.3