diff --git a/packages/clerk-js/src/core/auth/AuthCookieService.ts b/packages/clerk-js/src/core/auth/AuthCookieService.ts index 514f2bd9a6..2887166180 100644 --- a/packages/clerk-js/src/core/auth/AuthCookieService.ts +++ b/packages/clerk-js/src/core/auth/AuthCookieService.ts @@ -1,12 +1,10 @@ import { setDevBrowserJWTInURL } from '@clerk/shared/devBrowser'; import { is4xxError, isClerkAPIResponseError, isNetworkError } from '@clerk/shared/error'; -import type { EnvironmentResource } from '@clerk/types'; +import type { Clerk, EnvironmentResource } from '@clerk/types'; import { clerkCoreErrorTokenRefreshFailed, clerkMissingDevBrowserJwt } from '../errors'; import { eventBus, events } from '../events'; import type { FapiClient } from '../fapiClient'; -import type { Clerk } from '../resources/internal'; -import { SessionTokenCache } from '../tokenCache'; import type { ClientUatCookieHandler } from './cookies/clientUat'; import { createClientUatCookie } from './cookies/clientUat'; import type { SessionCookieHandler } from './cookies/session'; @@ -105,19 +103,6 @@ export class AuthCookieService { return setDevBrowserJWTInURL(url, devBrowserJwt); } - /** - * Will refresh the session token immediately once - * if the captcha heartbeat flag is enabled. - * We want to do this to ensure that we collect at least one token - * even for short-lived sessions. - */ - public forceRefreshSessionToken() { - if (this.clerk.__unstable__environment?.displayConfig.captchaHeartbeat) { - SessionTokenCache.clear(); - void this.refreshSessionToken(); - } - } - private startPollingForToken() { if (!this.poller) { this.poller = new SessionCookiePoller(); diff --git a/packages/clerk-js/src/core/clerk.ts b/packages/clerk-js/src/core/clerk.ts index 536c5ab7bf..db377ee7cc 100644 --- a/packages/clerk-js/src/core/clerk.ts +++ b/packages/clerk-js/src/core/clerk.ts @@ -1828,8 +1828,8 @@ export class Clerk implements ClerkInterface { } } - this.#authService?.forceRefreshSessionToken(); this.#clearClerkQueryParams(); + this.#handleImpersonationFab(); return true; };