Skip to content

Commit

Permalink
fix: user not found error
Browse files Browse the repository at this point in the history
  • Loading branch information
ParzivalEugene committed Aug 9, 2024
1 parent c1e3929 commit f40acdd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/services/user_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,11 @@ pub async fn sign_in(
user: &NewUser,
device: &DeviceInfo,
) -> Result<Tokens, InternalError> {
let user_db = get_by_email(pool, &user.email).await?;
let user_db = get_by_email(pool, &user.email).await.map_err(|_| {
error!("User not found: {}", user.email);
InternalError::AuthError(AuthError::UserNotFound)
})?;

if user_db.classic_auth.is_none() {
error!("User has no classic auth: {}", user.email);
return Err(InternalError::AuthError(AuthError::NoClassicAuth));
Expand Down

0 comments on commit f40acdd

Please sign in to comment.