<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>OAuth Flow Test - Real Authentication</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 20px;
        }
        
        .container {
            background: white;
            border-radius: 20px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.3);
            padding: 40px;
            max-width: 600px;
            width: 100%;
        }
        
        h1 {
            color: #333;
            margin-bottom: 10px;
            text-align: center;
        }
        
        .subtitle {
            color: #666;
            text-align: center;
            margin-bottom: 30px;
            font-size: 14px;
        }
        
        .info {
            background: #e7f3ff;
            border: 2px solid #b3d9ff;
            color: #004085;
            padding: 20px;
            border-radius: 8px;
            margin-bottom: 30px;
            font-size: 14px;
            line-height: 1.6;
        }
        
        .info strong {
            display: block;
            margin-bottom: 10px;
            font-size: 16px;
        }
        
        .btn {
            width: 100%;
            padding: 18px 20px;
            margin: 10px 0;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            text-decoration: none;
            color: white;
        }
        
        .btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(0,0,0,0.3);
        }
        
        .btn-google {
            background: #4285f4;
        }
        
        .btn-google:hover {
            background: #357ae8;
        }
        
        .btn-github {
            background: #24292e;
        }
        
        .btn-github:hover {
            background: #1a1e22;
        }
        
        .icon {
            font-size: 24px;
        }
        
        .setup-section {
            background: #fff3cd;
            border: 2px solid #ffc107;
            color: #856404;
            padding: 20px;
            border-radius: 8px;
            margin-top: 30px;
            font-size: 13px;
        }
        
        .setup-section h3 {
            margin-bottom: 10px;
            color: #856404;
        }
        
        .setup-section ol {
            margin-left: 20px;
            line-height: 1.8;
        }
        
        .setup-section code {
            background: white;
            padding: 2px 6px;
            border-radius: 3px;
            font-family: 'Courier New', monospace;
            border: 1px solid #e0e0e0;
        }
        
        .divider {
            text-align: center;
            margin: 30px 0;
            color: #999;
            position: relative;
        }
        
        .divider::before,
        .divider::after {
            content: "";
            position: absolute;
            top: 50%;
            width: 45%;
            height: 1px;
            background: #ddd;
        }
        
        .divider::before {
            left: 0;
        }
        
        .divider::after {
            right: 0;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>🔐 OAuth Flow Test</h1>
        <p class="subtitle">Gerçek OAuth Authentication - Django REST API</p>
        
        <div class="info">
            <strong>✨ Nasıl Çalışır?</strong>
            <p>
                Butona tıkladığınızda GitHub veya Google'ın kendi sayfasına yönlendirileceksiniz.
                Orada giriş yapıp izin verdikten sonra, otomatik olarak geri dönecek ve 
                JWT token'larınız gösterilecek!
            </p>
        </div>
        
        <a href="http://localhost:8000/api/v1/social/login/google-oauth2/" class="btn btn-google">
            <span class="icon">🔵</span>
            Login with Google
        </a>
        
        <div class="divider">VEYA</div>
        
        <a href="http://localhost:8000/api/v1/social/login/github/" class="btn btn-github">
            <span class="icon">⚫</span>
            Login with GitHub
        </a>
        
        <div class="setup-section">
            <h3>⚠️ GitHub OAuth App Ayarları</h3>
            <p>GitHub OAuth çalışması için callback URL'ini ayarlamalısınız:</p>
            <ol>
                <li><strong>Git:</strong> <a href="https://github.com/settings/developers" target="_blank">GitHub Settings → OAuth Apps</a></li>
                <li>OAuth App'inizi bulun veya yeni oluşturun</li>
                <li><strong>Authorization callback URL:</strong> <code>http://localhost:8000/api/v1/social/complete/github/</code></li>
                <li>Kaydet</li>
            </ol>
            
            <h3 style="margin-top: 15px;">⚠️ Google OAuth App Ayarları</h3>
            <ol>
                <li><strong>Git:</strong> <a href="https://console.cloud.google.com/apis/credentials" target="_blank">Google Cloud Console</a></li>
                <li>OAuth 2.0 Client ID'nizi düzenleyin</li>
                <li><strong>Authorized redirect URIs:</strong> <code>http://localhost:8000/api/v1/social/complete/google-oauth2/</code></li>
                <li><strong>Authorized JavaScript origins:</strong> <code>http://localhost:8000</code></li>
                <li>Kaydet</li>
            </ol>
        </div>
    </div>
</body>
</html>

