Spaces:
Runtime error
Runtime error
| #!/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() |