#!/bin/bash

# Google OAuth Test Script
# Usage: ./test_google.sh <access_token>

if [ -z "$1" ]; then
    echo "❌ Access token gerekli!"
    echo ""
    echo "Kullanım: ./test_google.sh <access_token>"
    echo ""
    echo "Token almak için:"
    echo "1. https://developers.google.com/oauthplayground/"
    echo "2. Settings → Use your own OAuth credentials"
    echo "3. Client ID: 915364976256-691m0s87as2r5vdbqr96f6humblseobt.apps.googleusercontent.com"
    echo "4. Client Secret: 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"
    echo "5. Scopes: userinfo.email, userinfo.profile"
    echo "6. Authorize → Exchange code for tokens"
    echo "7. Access token'ı kopyala"
    exit 1
fi

ACCESS_TOKEN="$1"

echo "🔵 Google OAuth Test"
echo "===================="
echo ""
echo "📤 Request gönderiliyor..."
echo ""

curl -X POST http://localhost:8000/api/v1/auth/social/google-oauth2/ \
  -H "Content-Type: application/json" \
  -d "{\"access_token\":\"$ACCESS_TOKEN\"}" \
  | python -m json.tool

echo ""
echo "===================="

