aboutsummaryrefslogtreecommitdiffstats
path: root/crates/api-auth/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/api-auth/src/lib.rs')
-rw-r--r--crates/api-auth/src/lib.rs10
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>;
}