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
+
+ - Go to Google Cloud Console
+ - Create a new project (or select existing)
+ - Navigate to APIs & Services > Library
+ - Search for and enable Google Calendar API
+ - Go to APIs & Services > Credentials
+ - Click + Create Credentials → OAuth client ID
+ - Application type: Web application
+ - Add Authorized redirect URI:
+ - Click Create and copy the Client ID
+ - Copy the Client Secret from the credentials page
+
+
+
+
+
Step 2: Enter Your Credentials
+
+
+
+
+
+
+
+
+
+
+
+
+
Step 3: Authorize Your Google Account
+
Click the button below and sign in with the Google account that owns the calendar you want to use:
+
+
Important: After authorization, you'll be redirected back. Copy the authorization code from the URL.
+
+
+
+
+
+
+
+
+
+
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:
+
+
+
+
+
+
+
+
+
+
+