diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2024-10-01 22:43:18 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2024-10-01 23:14:49 -0400 |
| commit | d171a258ad2119e39cb715f8800031fff16967dc (patch) | |
| tree | 453cf4c65fa18ff98ef13d9730f1a0f74ff68540 /src/login/app.rs | |
| parent | b8392a5fe824eff46f912a58885546e7b0f37e6f (diff) | |
Provide a resume point to bridge clients from state snapshots to the event sequence.
Diffstat (limited to 'src/login/app.rs')
| -rw-r--r-- | src/login/app.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/login/app.rs b/src/login/app.rs index 95f0a07..f1dffb9 100644 --- a/src/login/app.rs +++ b/src/login/app.rs @@ -13,6 +13,7 @@ use crate::{ repo::{ error::NotFound as _, login::{Login, Provider as _}, + sequence::{Provider as _, Sequence}, token::{self, Provider as _}, }, }; @@ -27,6 +28,14 @@ impl<'a> Logins<'a> { Self { db, logins } } + pub async fn boot_point(&self) -> Result<Sequence, sqlx::Error> { + let mut tx = self.db.begin().await?; + let sequence = tx.sequence().current().await?; + tx.commit().await?; + + Ok(sequence) + } + pub async fn login( &self, name: &str, |
