add passkey support
This commit is contained in:
@@ -125,6 +125,20 @@ impl AuthService {
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn find_user_by_email(&self, email: String) -> DomainResult<Option<(User, String)>> {
|
||||
let users = Arc::clone(&self.users);
|
||||
self.db
|
||||
.run(move |txn| Box::pin(async move { users.find_user_by_email(txn, email).await }))
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn create_session_for_user(&self, user_id: i64) -> DomainResult<(String, String)> {
|
||||
let sessions = Arc::clone(&self.sessions);
|
||||
self.db
|
||||
.run(move |txn| Box::pin(async move { sessions.create_session(txn, user_id).await }))
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn logout(&self, session_token: String) -> DomainResult<()> {
|
||||
let sessions = Arc::clone(&self.sessions);
|
||||
self.db
|
||||
|
||||
Reference in New Issue
Block a user