feat: redesign superadmin agencies list, implement flat design, add date filters, and fix UI bugs
This commit is contained in:
@@ -2,6 +2,7 @@ package service
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"aggios-app/backend/internal/config"
|
||||
@@ -78,14 +79,20 @@ func (s *AuthService) Login(req domain.LoginRequest) (*domain.LoginResponse, err
|
||||
// Find user by email
|
||||
user, err := s.userRepo.FindByEmail(req.Email)
|
||||
if err != nil {
|
||||
log.Printf("❌ DB error finding user %s: %v", req.Email, err)
|
||||
return nil, err
|
||||
}
|
||||
if user == nil {
|
||||
log.Printf("❌ User not found: %s", req.Email)
|
||||
return nil, ErrInvalidCredentials
|
||||
}
|
||||
|
||||
log.Printf("🔍 Attempting login for %s with password_hash: %.10s...", req.Email, user.Password)
|
||||
log.Printf("🔍 Provided password length: %d", len(req.Password))
|
||||
|
||||
// Verify password
|
||||
if err := bcrypt.CompareHashAndPassword([]byte(user.Password), []byte(req.Password)); err != nil {
|
||||
log.Printf("❌ Password mismatch for %s: %v", req.Email, err)
|
||||
return nil, ErrInvalidCredentials
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user