[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...')
|
const toastId = toast.loading('Submitting to Text-to-CAD API...')
|
||||||
|
|
||||||
let submitResult
|
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 {
|
try {
|
||||||
submitResult = await submitPromptToEditToQueue({
|
submitResult = await submitPromptToEditToQueue({
|
||||||
prompt,
|
prompt,
|
||||||
|
@ -216,9 +216,9 @@ async function getAndSyncStoredToken(input: {
|
|||||||
['api token', !!VITE_KITTYCAD_API_TOKEN],
|
['api token', !!VITE_KITTYCAD_API_TOKEN],
|
||||||
])
|
])
|
||||||
if (token) {
|
if (token) {
|
||||||
|
if (isDesktop()) {
|
||||||
// has just logged in, update storage
|
// has just logged in, update storage
|
||||||
localStorage.setItem(TOKEN_PERSIST_KEY, token)
|
localStorage.setItem(TOKEN_PERSIST_KEY, token)
|
||||||
if (isDesktop()) {
|
|
||||||
await writeTokenFile(token)
|
await writeTokenFile(token)
|
||||||
}
|
}
|
||||||
return token
|
return token
|
||||||
|
Reference in New Issue
Block a user