File size: 1,001 Bytes
ac90985
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python3
import sqlite3
from app.core.security import get_password_hash, verify_password

def debug_auth():
    # Connect to SQLite database
    conn = sqlite3.connect('customeragent.db')
    cursor = conn.cursor()
    
    # Get all users
    cursor.execute("SELECT id, email, hashed_password FROM users")
    users = cursor.fetchall()
    
    print("📊 Users in database:")
    for user_id, email, hashed_password in users:
        print(f"ID: {user_id}, Email: {email}")
        
        # Test password verification with common passwords
        test_passwords = ["test123", "testpass123", "password"]
        for pwd in test_passwords:
            if verify_password(pwd, hashed_password):
                print(f"  ✅ Password '{pwd}' works for {email}")
                break
        else:
            print(f"  ❌ None of the test passwords work for {email}")
            print(f"  Hash: {hashed_password}")
    
    conn.close()

if __name__ == "__main__":
    debug_auth()