[Bug fix]: Do not store token in window! (#7671)

* fix: we really cannot do this

* fix: limiting footprint
This commit is contained in:
Kevin Nadro
2025-07-04 10:57:29 -05:00
committed by GitHub
parent 597f4a1d54
commit 01230b0aa1
2 changed files with 2 additions and 10 deletions

View File

@ -336,14 +336,6 @@ export async function doPromptEdit({
const toastId = toast.loading('Submitting to Text-to-CAD API...')
let submitResult
// work around for @kittycad/lib not really being built for the browser
;(window as any).process = {
env: {
ZOO_API_TOKEN: token,
ZOO_HOST: withAPIBaseURL(''),
},
}
try {
submitResult = await submitPromptToEditToQueue({
prompt,

View File

@ -216,9 +216,9 @@ async function getAndSyncStoredToken(input: {
['api token', !!VITE_KITTYCAD_API_TOKEN],
])
if (token) {
// has just logged in, update storage
localStorage.setItem(TOKEN_PERSIST_KEY, token)
if (isDesktop()) {
// has just logged in, update storage
localStorage.setItem(TOKEN_PERSIST_KEY, token)
await writeTokenFile(token)
}
return token