diff options
| author | rtkay123 <dev@kanjala.com> | 2026-02-02 13:30:25 +0200 |
|---|---|---|
| committer | rtkay123 <dev@kanjala.com> | 2026-02-02 13:30:25 +0200 |
| commit | 549d98f3b457ddfc6dffbe2fad406da4ac50ebc7 (patch) | |
| tree | d1563d048eb7600f0f1265766efffb2797280051 /src/server/routes/auth | |
| parent | e06094f23ca861ea5ae4864d11fa8ce8b7d7aa2c (diff) | |
| download | sellershut-549d98f3b457ddfc6dffbe2fad406da4ac50ebc7.tar.bz2 sellershut-549d98f3b457ddfc6dffbe2fad406da4ac50ebc7.zip | |
refactor: collapse auth
Diffstat (limited to 'src/server/routes/auth')
| -rw-r--r-- | src/server/routes/auth/discord.rs | 20 |
1 files changed, 13 insertions, 7 deletions
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<AppState>) -> Result<impl IntoResponse, AppError> { + let data = data.app_data(); -async fn auth( - State(client): State<Arc<dyn SellershutDriver>>, -) -> Result<impl IntoResponse, AppError> { - 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()) } |
