diff options
| author | rtkay123 <dev@kanjala.com> | 2026-04-10 23:48:24 +0200 |
|---|---|---|
| committer | rtkay123 <dev@kanjala.com> | 2026-04-10 23:48:24 +0200 |
| commit | f06288f156ccb8f9ebf35782a179bf57e6bc8fc2 (patch) | |
| tree | 2e9eb80237094d930b4f3a54261fac0cb3350129 /crates/api-auth/src/lib.rs | |
| parent | be2af8a5fe2e58953b4970e3fed970165fc4b4ca (diff) | |
| download | sellershut-f06288f156ccb8f9ebf35782a179bf57e6bc8fc2.tar.bz2 sellershut-f06288f156ccb8f9ebf35782a179bf57e6bc8fc2.zip | |
feat(auth): get user
Diffstat (limited to 'crates/api-auth/src/lib.rs')
| -rw-r--r-- | crates/api-auth/src/lib.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/crates/api-auth/src/lib.rs b/crates/api-auth/src/lib.rs index 85fdb01..815b170 100644 --- a/crates/api-auth/src/lib.rs +++ b/crates/api-auth/src/lib.rs @@ -1,6 +1,8 @@ #[cfg(feature = "discord")] pub mod discord; +pub mod client; + mod error; use api_core::auth::AuthClientConfig; use api_core::models::user::User; @@ -21,8 +23,12 @@ pub struct BasicClient(C); #[async_trait::async_trait] pub trait OauthDriver: Send + Sync { - async fn get_auth_token(&self) -> Result<String, AuthError>; - async fn get_user(&self) -> Result<User, AuthError>; + async fn get_user( + &self, + client: &client::AuthHttpClient, + code: &str, + ) -> Result<User, AuthError>; + async fn validate_session(&self, cookie: &str, state: &str) -> Result<(), AuthError>; async fn create_oauth_session(&self) -> Result<SessionResponse, AuthError>; async fn save_session(&self, user: &User) -> Result<(), AuthError>; } |
