aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/auth-service/src/client/mod.rs2
-rw-r--r--lib/auth-service/src/service/mod.rs9
2 files changed, 9 insertions, 2 deletions
diff --git a/lib/auth-service/src/client/mod.rs b/lib/auth-service/src/client/mod.rs
index e02672b..774a863 100644
--- a/lib/auth-service/src/client/mod.rs
+++ b/lib/auth-service/src/client/mod.rs
@@ -30,7 +30,7 @@ impl Deref for OauthClient {
}
}
-#[derive(Debug)]
+#[derive(Debug, Clone)]
pub struct ClientConfig {
client_id: String,
client_secret: SecretString,
diff --git a/lib/auth-service/src/service/mod.rs b/lib/auth-service/src/service/mod.rs
index 31c9019..b699c51 100644
--- a/lib/auth-service/src/service/mod.rs
+++ b/lib/auth-service/src/service/mod.rs
@@ -30,7 +30,14 @@ pub struct AuthService {
impl AccountMgr for AuthService {
#[instrument(skip(self))]
async fn get_apid_by_email(&self, email: &str) -> Result<Option<String>> {
- todo!()
+ let result = sqlx::query_scalar!(
+ "select user_id from account where email = $1 limit 1",
+ email
+ )
+ .fetch_optional(&self.database)
+ .await?;
+ debug!(user = ?result, "find my email");
+ Ok(result)
}
#[instrument(skip(transaction))]