refactor(backend): replace unwraps with typed errors

This commit is contained in:
2026-06-13 12:38:44 +03:00
parent 21d65af470
commit 2616896ecb
6 changed files with 181 additions and 201 deletions

View File

@@ -29,6 +29,7 @@ pub async fn mw_ctx_resolver(
Some(token) => user_repository
.get_session(&token)
.await
.and_then(|s| s.ok_or(LoftError::AuthFailSessionNotFound))
.map(|s| Ctx::new(s.user_id)),
None => Err(LoftError::AuthFailNoAuthTokenCookie),
};