fix: /login now has better error handling/reporting

This commit is contained in:
2026-09-01 15:38:17 +02:00
parent b35dc4841f
commit 26aa0c2a94
3 changed files with 18 additions and 2 deletions
+3
View File
@@ -36,6 +36,9 @@ func (r *AuthRepo) GetUserByEmail(ctx context.Context, email string) (*domain.Au
email,
).Scan(&user.ID, &user.Email, &user.Name, &user.PasswordHash)
if err != nil {
if errors.Is(err, sql.ErrNoRows) {
return nil, domain.ErrEmailNotFound
}
return nil, fmt.Errorf("failed to get user: %w", err)
}