summaryrefslogtreecommitdiff
path: root/src/token/repo
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2024-10-11 21:16:11 -0400
committerOwen Jacobson <owen@grimoire.ca>2024-10-11 21:16:11 -0400
commit864febeefc5213928bf88f89a714a006326e5b41 (patch)
treeb684ab871771044d2b8153f018eb49a001610f72 /src/token/repo
parent62349ab4ce463b6aafd818021849c63f60f6bf49 (diff)
Stop creating accounts during login.
Diffstat (limited to 'src/token/repo')
-rw-r--r--src/token/repo/auth.rs10
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)