From c7bed6817a4658255261ca53cd5c3f1b610975a1 Mon Sep 17 00:00:00 2001 From: wobsoriano Date: Fri, 30 Jan 2026 16:15:00 -0800 Subject: [PATCH 01/13] chore(clerk-js): add FedCM compatibility for Google One Tap in Chrome 145+ --- .../components/GoogleOneTap/one-tap-start.tsx | 17 +++++++++++++-- packages/clerk-js/src/utils/one-tap.ts | 21 ++++++++++++++++++- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx b/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx index ce4f5a97c2b..422c2aa0e8e 100644 --- a/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx +++ b/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx @@ -66,8 +66,21 @@ function OneTapStartInternal(): JSX.Element | null { useEffect(() => { if (initializedGoogle && !user?.id && !isPromptedRef.current) { initializedGoogle.accounts.id.prompt(notification => { - // Close the modal, when the user clicks outside the prompt or cancels - if (notification.getMomentType() === 'skipped') { + // Close the modal when the user clicks outside the prompt or cancels + // Per FedCM migration guide, we should use isSkippedMoment() which continues to work + // Fall back to getMomentType() for legacy browsers that haven't migrated yet + // Reference: https://developers.google.com/identity/gsi/web/guides/fedcm-migration + let isSkipped = false; + + if ('isSkippedMoment' in notification && typeof notification.isSkippedMoment === 'function') { + // FedCM-compatible method (preferred) + isSkipped = notification.isSkippedMoment(); + } else if ('getMomentType' in notification && typeof notification.getMomentType === 'function') { + // Legacy method for backward compatibility + isSkipped = notification.getMomentType() === 'skipped'; + } + + if (isSkipped) { // Unmounts the component will cause the useEffect cleanup function from below to be called clerk.closeGoogleOneTap(); } diff --git a/packages/clerk-js/src/utils/one-tap.ts b/packages/clerk-js/src/utils/one-tap.ts index 4b56a2b083a..f7fd3fbf3ec 100644 --- a/packages/clerk-js/src/utils/one-tap.ts +++ b/packages/clerk-js/src/utils/one-tap.ts @@ -15,10 +15,29 @@ interface InitializeProps { use_fedcm_for_prompt?: boolean; } -interface PromptMomentNotification { +// Legacy methods that are removed in FedCM mode +interface LegacyPromptMomentNotification { getMomentType: () => 'display' | 'skipped' | 'dismissed'; + // These methods are deprecated and will not work with FedCM enabled + isDisplayMoment?: () => boolean; + isDisplayed?: () => boolean; + isNotDisplayed?: () => boolean; + getNotDisplayedReason?: () => string; + getSkippedReason?: () => string; } +// FedCM-compatible methods (safe to use regardless of FedCM mode) +interface FedCMPromptMomentNotification { + getMomentType: () => 'display' | 'skipped' | 'dismissed'; + // These methods continue to work with FedCM + isSkippedMoment?: () => boolean; + isDismissedMoment?: () => boolean; + getDismissedReason?: () => string; +} + +// Union type for backward compatibility +type PromptMomentNotification = LegacyPromptMomentNotification & FedCMPromptMomentNotification; + interface OneTapMethods { initialize: (params: InitializeProps) => void; prompt: (promptListener: (promptMomentNotification: PromptMomentNotification) => void) => void; From 228b47a35670eec82d865e1ba7a88434057bd1a9 Mon Sep 17 00:00:00 2001 From: wobsoriano Date: Fri, 30 Jan 2026 16:22:35 -0800 Subject: [PATCH 02/13] chore: make readable --- .../components/GoogleOneTap/one-tap-start.tsx | 42 ++++++++++++------- packages/clerk-js/src/utils/one-tap.ts | 2 +- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx b/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx index 422c2aa0e8e..4ee1b8acd0b 100644 --- a/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx +++ b/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx @@ -4,12 +4,35 @@ import { useEffect, useRef } from 'react'; import { withCardStateProvider } from '@/ui/elements/contexts'; import { clerkUnsupportedEnvironmentWarning } from '../../../core/errors'; -import type { GISCredentialResponse } from '../../../utils/one-tap'; +import type { GISCredentialResponse, PromptMomentNotification } from '../../../utils/one-tap'; import { loadGIS } from '../../../utils/one-tap'; import { useEnvironment, useGoogleOneTapContext } from '../../contexts'; import { useFetch } from '../../hooks'; import { useRouter } from '../../router'; +/** + * Checks if the Google One Tap prompt was skipped by the user. + * Uses FedCM-compatible methods with fallback to legacy methods for backward compatibility. + * + * Per FedCM migration guide, isSkippedMoment() continues to work with FedCM, + * while getMomentType() may be removed in future Chrome versions. + * + * @see https://developers.google.com/identity/gsi/web/guides/fedcm-migration + */ +function isPromptSkipped(notification: PromptMomentNotification): boolean { + if ('isSkippedMoment' in notification && typeof notification.isSkippedMoment === 'function') { + // FedCM-compatible method (preferred) + return notification.isSkippedMoment(); + } + + if ('getMomentType' in notification && typeof notification.getMomentType === 'function') { + // Legacy method for backward compatibility + return notification.getMomentType() === 'skipped'; + } + + return false; +} + function OneTapStartInternal(): JSX.Element | null { const clerk = useClerk(); const { user } = useUser(); @@ -66,21 +89,8 @@ function OneTapStartInternal(): JSX.Element | null { useEffect(() => { if (initializedGoogle && !user?.id && !isPromptedRef.current) { initializedGoogle.accounts.id.prompt(notification => { - // Close the modal when the user clicks outside the prompt or cancels - // Per FedCM migration guide, we should use isSkippedMoment() which continues to work - // Fall back to getMomentType() for legacy browsers that haven't migrated yet - // Reference: https://developers.google.com/identity/gsi/web/guides/fedcm-migration - let isSkipped = false; - - if ('isSkippedMoment' in notification && typeof notification.isSkippedMoment === 'function') { - // FedCM-compatible method (preferred) - isSkipped = notification.isSkippedMoment(); - } else if ('getMomentType' in notification && typeof notification.getMomentType === 'function') { - // Legacy method for backward compatibility - isSkipped = notification.getMomentType() === 'skipped'; - } - - if (isSkipped) { + if (isPromptSkipped(notification)) { + // Close the modal when the user clicks outside the prompt or cancels // Unmounts the component will cause the useEffect cleanup function from below to be called clerk.closeGoogleOneTap(); } diff --git a/packages/clerk-js/src/utils/one-tap.ts b/packages/clerk-js/src/utils/one-tap.ts index f7fd3fbf3ec..eeef06b95bd 100644 --- a/packages/clerk-js/src/utils/one-tap.ts +++ b/packages/clerk-js/src/utils/one-tap.ts @@ -71,4 +71,4 @@ async function loadGIS() { } export { loadGIS }; -export type { GISCredentialResponse }; +export type { GISCredentialResponse, PromptMomentNotification }; From c48ef4a7d326f5a25f630a834aa1cf2fdf220bf8 Mon Sep 17 00:00:00 2001 From: wobsoriano Date: Fri, 30 Jan 2026 16:24:58 -0800 Subject: [PATCH 03/13] chore: removed unnecessary comment --- packages/clerk-js/src/utils/one-tap.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/clerk-js/src/utils/one-tap.ts b/packages/clerk-js/src/utils/one-tap.ts index eeef06b95bd..8d68275f711 100644 --- a/packages/clerk-js/src/utils/one-tap.ts +++ b/packages/clerk-js/src/utils/one-tap.ts @@ -35,7 +35,6 @@ interface FedCMPromptMomentNotification { getDismissedReason?: () => string; } -// Union type for backward compatibility type PromptMomentNotification = LegacyPromptMomentNotification & FedCMPromptMomentNotification; interface OneTapMethods { From 01cacd6404a919984d0221009a0693f15aafc1cb Mon Sep 17 00:00:00 2001 From: wobsoriano Date: Fri, 30 Jan 2026 16:31:30 -0800 Subject: [PATCH 04/13] chore: clean up unused types --- packages/clerk-js/src/utils/one-tap.ts | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/packages/clerk-js/src/utils/one-tap.ts b/packages/clerk-js/src/utils/one-tap.ts index 8d68275f711..e02e408910c 100644 --- a/packages/clerk-js/src/utils/one-tap.ts +++ b/packages/clerk-js/src/utils/one-tap.ts @@ -15,28 +15,18 @@ interface InitializeProps { use_fedcm_for_prompt?: boolean; } -// Legacy methods that are removed in FedCM mode -interface LegacyPromptMomentNotification { - getMomentType: () => 'display' | 'skipped' | 'dismissed'; - // These methods are deprecated and will not work with FedCM enabled - isDisplayMoment?: () => boolean; - isDisplayed?: () => boolean; - isNotDisplayed?: () => boolean; - getNotDisplayedReason?: () => string; - getSkippedReason?: () => string; -} - -// FedCM-compatible methods (safe to use regardless of FedCM mode) -interface FedCMPromptMomentNotification { - getMomentType: () => 'display' | 'skipped' | 'dismissed'; - // These methods continue to work with FedCM +interface PromptMomentNotification { + // FedCM-compatible methods (continue to work) isSkippedMoment?: () => boolean; isDismissedMoment?: () => boolean; getDismissedReason?: () => string; + // Legacy methods (may be removed when FedCM becomes mandatory) + getMomentType?: () => 'display' | 'skipped' | 'dismissed'; + isDisplayMoment?: () => boolean; + getNotDisplayedReason?: () => string; + getSkippedReason?: () => string; } -type PromptMomentNotification = LegacyPromptMomentNotification & FedCMPromptMomentNotification; - interface OneTapMethods { initialize: (params: InitializeProps) => void; prompt: (promptListener: (promptMomentNotification: PromptMomentNotification) => void) => void; From dff66e219bbba9c85c61c6c19cf3e96bdc14dc59 Mon Sep 17 00:00:00 2001 From: wobsoriano Date: Fri, 30 Jan 2026 16:35:56 -0800 Subject: [PATCH 05/13] chore: clean up unused types --- packages/clerk-js/src/utils/one-tap.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/packages/clerk-js/src/utils/one-tap.ts b/packages/clerk-js/src/utils/one-tap.ts index e02e408910c..827695f1dbf 100644 --- a/packages/clerk-js/src/utils/one-tap.ts +++ b/packages/clerk-js/src/utils/one-tap.ts @@ -16,15 +16,19 @@ interface InitializeProps { } interface PromptMomentNotification { - // FedCM-compatible methods (continue to work) + /** + * FedCM-compatible method to check if the prompt was skipped. + * This method continues to work with FedCM enabled. + * @see https://developers.google.com/identity/gsi/web/guides/fedcm-migration + */ isSkippedMoment?: () => boolean; - isDismissedMoment?: () => boolean; - getDismissedReason?: () => string; - // Legacy methods (may be removed when FedCM becomes mandatory) + /** + * Legacy method to get the moment type. + * @deprecated This method may be removed when FedCM becomes mandatory in Chrome. + * Use isSkippedMoment() instead for forward compatibility. + * @see https://developers.google.com/identity/gsi/web/guides/fedcm-migration + */ getMomentType?: () => 'display' | 'skipped' | 'dismissed'; - isDisplayMoment?: () => boolean; - getNotDisplayedReason?: () => string; - getSkippedReason?: () => string; } interface OneTapMethods { From 1db0e2e40c5d33bb4b0c72a08d74f36f57a4006b Mon Sep 17 00:00:00 2001 From: wobsoriano Date: Fri, 30 Jan 2026 16:42:10 -0800 Subject: [PATCH 06/13] chore: add simple unit test --- .../__tests__/isPromptSkipped.test.ts | 30 +++++++++++++++++++ .../components/GoogleOneTap/one-tap-start.tsx | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 packages/clerk-js/src/ui/components/GoogleOneTap/__tests__/isPromptSkipped.test.ts diff --git a/packages/clerk-js/src/ui/components/GoogleOneTap/__tests__/isPromptSkipped.test.ts b/packages/clerk-js/src/ui/components/GoogleOneTap/__tests__/isPromptSkipped.test.ts new file mode 100644 index 00000000000..1a49f6b35b5 --- /dev/null +++ b/packages/clerk-js/src/ui/components/GoogleOneTap/__tests__/isPromptSkipped.test.ts @@ -0,0 +1,30 @@ +import { describe, expect, it } from 'vitest'; + +import { isPromptSkipped } from '../one-tap-start'; + +describe('isPromptSkipped', () => { + it('returns true when isSkippedMoment returns true', () => { + expect(isPromptSkipped({ isSkippedMoment: () => true })).toBe(true); + }); + + it('returns true when getMomentType returns skipped', () => { + expect(isPromptSkipped({ getMomentType: () => 'skipped' })).toBe(true); + }); + + it('returns false when getMomentType returns dismissed', () => { + expect(isPromptSkipped({ getMomentType: () => 'dismissed' })).toBe(false); + }); + + it('returns false when no methods exist', () => { + expect(isPromptSkipped({})).toBe(false); + }); + + it('prioritizes isSkippedMoment over getMomentType', () => { + expect( + isPromptSkipped({ + isSkippedMoment: () => true, + getMomentType: () => 'dismissed', + }), + ).toBe(true); + }); +}); diff --git a/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx b/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx index 4ee1b8acd0b..d255460c49c 100644 --- a/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx +++ b/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx @@ -19,7 +19,7 @@ import { useRouter } from '../../router'; * * @see https://developers.google.com/identity/gsi/web/guides/fedcm-migration */ -function isPromptSkipped(notification: PromptMomentNotification): boolean { +export function isPromptSkipped(notification: PromptMomentNotification): boolean { if ('isSkippedMoment' in notification && typeof notification.isSkippedMoment === 'function') { // FedCM-compatible method (preferred) return notification.isSkippedMoment(); From 039597ed081278fe00bb81915e77248615412367 Mon Sep 17 00:00:00 2001 From: wobsoriano Date: Fri, 30 Jan 2026 19:33:56 -0800 Subject: [PATCH 07/13] chore: add test llogs --- .../src/ui/components/GoogleOneTap/one-tap-start.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx b/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx index d255460c49c..898d4129bd4 100644 --- a/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx +++ b/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx @@ -20,16 +20,26 @@ import { useRouter } from '../../router'; * @see https://developers.google.com/identity/gsi/web/guides/fedcm-migration */ export function isPromptSkipped(notification: PromptMomentNotification): boolean { + // Debug: log available methods + console.log('[Clerk Debug] Notification methods:', { + hasIsSkippedMoment: 'isSkippedMoment' in notification, + hasGetMomentType: 'getMomentType' in notification, + allKeys: Object.keys(notification), + }); + if ('isSkippedMoment' in notification && typeof notification.isSkippedMoment === 'function') { // FedCM-compatible method (preferred) + console.log('[Clerk Debug] Using isSkippedMoment()'); return notification.isSkippedMoment(); } if ('getMomentType' in notification && typeof notification.getMomentType === 'function') { // Legacy method for backward compatibility + console.log('[Clerk Debug] Using getMomentType()'); return notification.getMomentType() === 'skipped'; } + console.log('[Clerk Debug] No skipped detection method available'); return false; } From bf9230ba0f01003ea97a1b3d38359be127d8b796 Mon Sep 17 00:00:00 2001 From: wobsoriano Date: Fri, 30 Jan 2026 19:45:45 -0800 Subject: [PATCH 08/13] chore: add test llogs --- .../components/GoogleOneTap/one-tap-start.tsx | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx b/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx index 898d4129bd4..239e3710bc3 100644 --- a/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx +++ b/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx @@ -20,26 +20,16 @@ import { useRouter } from '../../router'; * @see https://developers.google.com/identity/gsi/web/guides/fedcm-migration */ export function isPromptSkipped(notification: PromptMomentNotification): boolean { - // Debug: log available methods - console.log('[Clerk Debug] Notification methods:', { - hasIsSkippedMoment: 'isSkippedMoment' in notification, - hasGetMomentType: 'getMomentType' in notification, - allKeys: Object.keys(notification), - }); - - if ('isSkippedMoment' in notification && typeof notification.isSkippedMoment === 'function') { - // FedCM-compatible method (preferred) - console.log('[Clerk Debug] Using isSkippedMoment()'); - return notification.isSkippedMoment(); + // Prioritize FedCM-compatible method + if ('isSkippedMoment' in notification) { + return notification.isSkippedMoment?.() ?? false; } - if ('getMomentType' in notification && typeof notification.getMomentType === 'function') { - // Legacy method for backward compatibility - console.log('[Clerk Debug] Using getMomentType()'); - return notification.getMomentType() === 'skipped'; + // Fallback to legacy method only if FedCM method doesn't exist + if ('getMomentType' in notification) { + return notification.getMomentType?.() === 'skipped'; } - console.log('[Clerk Debug] No skipped detection method available'); return false; } From 65ea9f54b7c57694e244e27a97132ee2e6280979 Mon Sep 17 00:00:00 2001 From: wobsoriano Date: Fri, 30 Jan 2026 20:10:54 -0800 Subject: [PATCH 09/13] chore: add test logs --- .../src/ui/components/GoogleOneTap/one-tap-start.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx b/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx index 239e3710bc3..80c32431994 100644 --- a/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx +++ b/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx @@ -26,9 +26,10 @@ export function isPromptSkipped(notification: PromptMomentNotification): boolean } // Fallback to legacy method only if FedCM method doesn't exist - if ('getMomentType' in notification) { - return notification.getMomentType?.() === 'skipped'; - } + // TODO: Temporarily commented out to test if this triggers the GSI_LOGGER warning + // if ('getMomentType' in notification) { + // return notification.getMomentType?.() === 'skipped'; + // } return false; } From b067a13acaa52ce6109240278174da9ee3373a2c Mon Sep 17 00:00:00 2001 From: wobsoriano Date: Fri, 30 Jan 2026 20:22:33 -0800 Subject: [PATCH 10/13] chore: add test logs --- .../clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx b/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx index 80c32431994..0ecb221d966 100644 --- a/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx +++ b/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx @@ -66,6 +66,8 @@ function OneTapStartInternal(): JSX.Element | null { const google = await loadGIS(); + console.log('[Clerk Debug] Initializing Google One Tap with fedCmSupport:', ctx.fedCmSupport); + google.accounts.id.initialize({ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion client_id: environmentClientID!, From 1220347819b3b7927a9324a891aabc496cc45a3f Mon Sep 17 00:00:00 2001 From: wobsoriano Date: Fri, 30 Jan 2026 20:32:04 -0800 Subject: [PATCH 11/13] chore: add test logs --- .../components/GoogleOneTap/one-tap-start.tsx | 43 +++++++++++++++---- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx b/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx index 0ecb221d966..e881f92bbf6 100644 --- a/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx +++ b/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx @@ -20,17 +20,26 @@ import { useRouter } from '../../router'; * @see https://developers.google.com/identity/gsi/web/guides/fedcm-migration */ export function isPromptSkipped(notification: PromptMomentNotification): boolean { + console.log('[Clerk Debug] isPromptSkipped called with notification:', { + hasIsSkippedMoment: 'isSkippedMoment' in notification, + hasGetMomentType: 'getMomentType' in notification, + }); + // Prioritize FedCM-compatible method if ('isSkippedMoment' in notification) { - return notification.isSkippedMoment?.() ?? false; + const result = notification.isSkippedMoment?.() ?? false; + console.log('[Clerk Debug] Using isSkippedMoment(), result:', result); + return result; } // Fallback to legacy method only if FedCM method doesn't exist - // TODO: Temporarily commented out to test if this triggers the GSI_LOGGER warning - // if ('getMomentType' in notification) { - // return notification.getMomentType?.() === 'skipped'; - // } + if ('getMomentType' in notification) { + const result = notification.getMomentType?.() === 'skipped'; + console.log('[Clerk Debug] Using getMomentType() fallback, result:', result); + return result; + } + console.log('[Clerk Debug] No skip detection method available, returning false'); return false; } @@ -44,14 +53,16 @@ function OneTapStartInternal(): JSX.Element | null { const ctx = useGoogleOneTapContext(); async function oneTapCallback(response: GISCredentialResponse) { + console.log('[Clerk Debug] oneTapCallback called'); isPromptedRef.current = false; try { const res = await clerk.authenticateWithGoogleOneTap({ token: response.credential, }); + console.log('[Clerk Debug] Authentication successful'); await clerk.handleGoogleOneTapCallback(res, ctx.generateCallbackUrls(window.location.href), navigate); } catch (e) { - console.error(e); + console.error('[Clerk Debug] Authentication error:', e); } } @@ -64,9 +75,17 @@ function OneTapStartInternal(): JSX.Element | null { return undefined; } + console.log('[Clerk Debug] Loading Google Identity Services...'); const google = await loadGIS(); + console.log('[Clerk Debug] Google Identity Services loaded'); - console.log('[Clerk Debug] Initializing Google One Tap with fedCmSupport:', ctx.fedCmSupport); + const useFedCm = ctx.fedCmSupport ?? true; + console.log('[Clerk Debug] Initializing Google One Tap with:', { + fedCmSupport: ctx.fedCmSupport, + use_fedcm_for_prompt: useFedCm, + itp_support: ctx.itpSupport, + cancel_on_tap_outside: ctx.cancelOnTapOutside, + }); google.accounts.id.initialize({ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion @@ -75,9 +94,11 @@ function OneTapStartInternal(): JSX.Element | null { itp_support: ctx.itpSupport, cancel_on_tap_outside: ctx.cancelOnTapOutside, auto_select: false, - use_fedcm_for_prompt: ctx.fedCmSupport, + // Default to true if not explicitly set (per the type definition) + use_fedcm_for_prompt: useFedCm, }); + console.log('[Clerk Debug] Google One Tap initialized successfully'); return google; } @@ -91,11 +112,16 @@ function OneTapStartInternal(): JSX.Element | null { useEffect(() => { if (initializedGoogle && !user?.id && !isPromptedRef.current) { + console.log('[Clerk Debug] Showing Google One Tap prompt...'); initializedGoogle.accounts.id.prompt(notification => { + console.log('[Clerk Debug] Prompt notification received'); if (isPromptSkipped(notification)) { + console.log('[Clerk Debug] Prompt was skipped, closing Google One Tap'); // Close the modal when the user clicks outside the prompt or cancels // Unmounts the component will cause the useEffect cleanup function from below to be called clerk.closeGoogleOneTap(); + } else { + console.log('[Clerk Debug] Prompt was not skipped'); } }); isPromptedRef.current = true; @@ -106,6 +132,7 @@ function OneTapStartInternal(): JSX.Element | null { useEffect(() => { return () => { if (initializedGoogle && isPromptedRef.current) { + console.log('[Clerk Debug] Cleanup: Cancelling Google One Tap prompt'); isPromptedRef.current = false; initializedGoogle.accounts.id.cancel(); } From 99dad39e69ef1e1fabdd45d165839ae87a168d89 Mon Sep 17 00:00:00 2001 From: wobsoriano Date: Fri, 30 Jan 2026 21:14:11 -0800 Subject: [PATCH 12/13] chore: add test logs --- .../clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx b/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx index e881f92bbf6..556f758c178 100644 --- a/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx +++ b/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx @@ -79,7 +79,8 @@ function OneTapStartInternal(): JSX.Element | null { const google = await loadGIS(); console.log('[Clerk Debug] Google Identity Services loaded'); - const useFedCm = ctx.fedCmSupport ?? true; + // TODO: Temporarily disable FedCM to test if it's causing the CORS error + const useFedCm = ctx.fedCmSupport ?? false; console.log('[Clerk Debug] Initializing Google One Tap with:', { fedCmSupport: ctx.fedCmSupport, use_fedcm_for_prompt: useFedCm, From cabac74321f56cad82f93ea74fe01a07cda6ed39 Mon Sep 17 00:00:00 2001 From: wobsoriano Date: Fri, 30 Jan 2026 21:20:19 -0800 Subject: [PATCH 13/13] chore: add test logs --- .../ui/components/GoogleOneTap/one-tap-start.tsx | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx b/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx index 556f758c178..a837a210ffd 100644 --- a/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx +++ b/packages/clerk-js/src/ui/components/GoogleOneTap/one-tap-start.tsx @@ -114,17 +114,8 @@ function OneTapStartInternal(): JSX.Element | null { useEffect(() => { if (initializedGoogle && !user?.id && !isPromptedRef.current) { console.log('[Clerk Debug] Showing Google One Tap prompt...'); - initializedGoogle.accounts.id.prompt(notification => { - console.log('[Clerk Debug] Prompt notification received'); - if (isPromptSkipped(notification)) { - console.log('[Clerk Debug] Prompt was skipped, closing Google One Tap'); - // Close the modal when the user clicks outside the prompt or cancels - // Unmounts the component will cause the useEffect cleanup function from below to be called - clerk.closeGoogleOneTap(); - } else { - console.log('[Clerk Debug] Prompt was not skipped'); - } - }); + // @ts-expect-error: testing + initializedGoogle.accounts.id.prompt(); isPromptedRef.current = true; } }, [clerk, initializedGoogle, user?.id]);