diff options
Diffstat (limited to 'src/token/repo/auth.rs')
| -rw-r--r-- | src/token/repo/auth.rs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/token/repo/auth.rs b/src/token/repo/auth.rs index ddb5136..9aee81f 100644 --- a/src/token/repo/auth.rs +++ b/src/token/repo/auth.rs @@ -19,13 +19,7 @@ impl<'c> Provider for Transaction<'c, Sqlite> { pub struct Auth<'t>(&'t mut SqliteConnection); impl<'t> Auth<'t> { - // Retrieves a login by name, plus its stored password hash for - // verification. If there's no login with the requested name, this will - // return [None]. - pub async fn for_name( - &mut self, - name: &str, - ) -> Result<Option<(History, StoredHash)>, sqlx::Error> { + pub async fn for_name(&mut self, name: &str) -> Result<(History, StoredHash), sqlx::Error> { let found = sqlx::query!( r#" select @@ -54,7 +48,7 @@ impl<'t> Auth<'t> { row.password_hash, ) }) - .fetch_optional(&mut *self.0) + .fetch_one(&mut *self.0) .await?; Ok(found) |
