Skip to content

Commit 01230b0

Browse files
authored
[Bug fix]: Do not store token in window! (#7671)
* fix: we really cannot do this * fix: limiting footprint
1 parent 597f4a1 commit 01230b0

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

src/lib/promptToEdit.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -336,14 +336,6 @@ export async function doPromptEdit({
336336
const toastId = toast.loading('Submitting to Text-to-CAD API...')
337337

338338
let submitResult
339-
340-
// work around for @kittycad/lib not really being built for the browser
341-
;(window as any).process = {
342-
env: {
343-
ZOO_API_TOKEN: token,
344-
ZOO_HOST: withAPIBaseURL(''),
345-
},
346-
}
347339
try {
348340
submitResult = await submitPromptToEditToQueue({
349341
prompt,

src/machines/authMachine.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,9 @@ async function getAndSyncStoredToken(input: {
216216
['api token', !!VITE_KITTYCAD_API_TOKEN],
217217
])
218218
if (token) {
219-
// has just logged in, update storage
220-
localStorage.setItem(TOKEN_PERSIST_KEY, token)
221219
if (isDesktop()) {
220+
// has just logged in, update storage
221+
localStorage.setItem(TOKEN_PERSIST_KEY, token)
222222
await writeTokenFile(token)
223223
}
224224
return token

0 commit comments

Comments
 (0)