fix(update): randomUUID crypto change is not working after being implemented on the online server.

This commit is contained in:
KodekaTeam committed 2026-06-05 14:19:45 +07:00
1 parent 17cbc2fb98
commit c30f828d2c
6 files changed
+96 -61

No files matched your search

+2 -4
View File
@@ -1,4 +1,5 @@
import type { GitProviderType } from "@/lib/api";
import { createClientId } from "@/lib/random-id";
const CALLBACK_INTENT_TTL_SECONDS = 15 * 60;
@@ -25,10 +26,7 @@ export function markGitProviderCallbackIntent(provider: GitProviderType): void {
return;
}
const nonce =
typeof crypto !== "undefined" && typeof crypto.randomUUID === "function"
? crypto.randomUUID()
: `${Date.now()}-${Math.random().toString(36).slice(2, 10)}`;
const nonce = createClientId();
document.cookie = `${getCallbackIntentCookieName(provider)}=${encodeURIComponent(nonce)}; ${buildCookieAttributes(provider).join("; ")}`;
}