[Bug fix]: Do not store token in window! (#7671)
* fix: we really cannot do this * fix: limiting footprint
This commit is contained in:
@ -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,
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user