diff --git a/get-google-token-local.html b/get-google-token-local.html new file mode 100644 index 0000000..e1ff024 --- /dev/null +++ b/get-google-token-local.html @@ -0,0 +1,320 @@ + + + + + + Google OAuth - Get Refresh Token + + + +
+

🔑 Google OAuth Setup for Personal Gmail

+ +
+ ⚠️ Important: This tool runs entirely in your browser. No data is sent to any server - it goes directly to Google's OAuth servers. +
+ +
+

Step 1: Create Google Cloud Project

+
    +
  1. Go to Google Cloud Console
  2. +
  3. Create a new project (or select existing)
  4. +
  5. Navigate to APIs & Services > Library
  6. +
  7. Search for and enable Google Calendar API
  8. +
  9. Go to APIs & Services > Credentials
  10. +
  11. Click + Create CredentialsOAuth client ID
  12. +
  13. Application type: Web application
  14. +
  15. Add Authorized redirect URI:
  16. +
  17. Click Create and copy the Client ID
  18. +
  19. Copy the Client Secret from the credentials page
  20. +
+
+ +
+

Step 2: Enter Your Credentials

+
+ + +
+
+ + +
+ +
+ + + +
+
+ + + + diff --git a/src/components/admin/settings/IntegrasiTab.tsx b/src/components/admin/settings/IntegrasiTab.tsx index 3c2b0c7..a0da9f0 100644 --- a/src/components/admin/settings/IntegrasiTab.tsx +++ b/src/components/admin/settings/IntegrasiTab.tsx @@ -52,6 +52,7 @@ export function IntegrasiTab() { const [saving, setSaving] = useState(false); const [testEmail, setTestEmail] = useState(''); const [sendingTest, setSendingTest] = useState(false); + const [isTestRunning, setIsTestRunning] = useState(false); useEffect(() => { fetchSettings(); @@ -380,9 +381,11 @@ export function IntegrasiTab() { return; } - // Prevent multiple simultaneous clicks - const btn = document.activeElement as HTMLButtonElement; - if (btn) btn.disabled = true; + if (isTestRunning) { + return; // Prevent React Strict Mode double-call + } + + setIsTestRunning(true); try { const { data, error } = await supabase.functions.invoke('create-google-meet-event', { @@ -406,9 +409,10 @@ export function IntegrasiTab() { } catch (err: any) { toast({ title: "Error", description: err.message, variant: "destructive" }); } finally { - if (btn) btn.disabled = false; + setIsTestRunning(false); } }} + disabled={isTestRunning} className="w-full border-2" > Test Google Calendar Connection diff --git a/test-oauth.html b/test-oauth.html new file mode 100644 index 0000000..493f0a3 --- /dev/null +++ b/test-oauth.html @@ -0,0 +1,152 @@ + + + + + + Test Google OAuth Config + + + +
+

Test Google OAuth Config

+

Paste your OAuth config JSON below to test if the refresh token is valid:

+ + + + + +
+
+ + + +