fix: auto fixes

This commit is contained in:
Kevin
2025-07-01 16:55:36 -05:00
parent 9389de083a
commit e85f116811
2 changed files with 6 additions and 10 deletions

View File

@ -697,7 +697,7 @@ export const readTokenFile = async () => {
export const writeTokenFile = async (token: string) => {
const tokenFilePath = await getTokenFilePath()
if (err(token)) return Promise.reject(token)
const result = window.electron.writeFile(tokenFilePath, token)
const result = window.electron.writeFile(tokenFilePath, token)
console.warn(`token written to disk`)
return result
}

View File

@ -1,8 +1,5 @@
import type { Models } from '@kittycad/lib'
import {
VITE_KC_API_BASE_URL,
VITE_KC_DEV_TOKEN,
} from '@src/env'
import { VITE_KC_API_BASE_URL, VITE_KC_DEV_TOKEN } from '@src/env'
import { assign, fromPromise, setup } from 'xstate'
import { COOKIE_NAME, OAUTH2_DEVICE_CLIENT_ID } from '@src/lib/constants'
@ -19,7 +16,6 @@ import {
} from '@src/lib/withBaseURL'
import { ACTOR_IDS } from '@src/machines/machineConstants'
const LOCAL_USER: Models['User_type'] = {
id: '8675309',
name: 'Test User',
@ -54,9 +50,7 @@ export type Events =
export const TOKEN_PERSIST_KEY = 'TOKEN_PERSIST_KEY'
export const persistedToken =
getCookie(COOKIE_NAME) ||
localStorage?.getItem(TOKEN_PERSIST_KEY) ||
''
getCookie(COOKIE_NAME) || localStorage?.getItem(TOKEN_PERSIST_KEY) || ''
export const authMachine = setup({
types: {} as {
context: UserContext
@ -223,7 +217,9 @@ async function getAndSyncStoredToken(input: {
token?: string
}): Promise<string> {
if (VITE_KC_DEV_TOKEN) {
console.warn(`Authentication skipped, VITE_KC_DEV_TOKEN:${!!VITE_KC_DEV_TOKEN ? '<REDACTED>' : 'Oh no, this should not be missing.'}`)
console.warn(
`Authentication skipped, VITE_KC_DEV_TOKEN:${!!VITE_KC_DEV_TOKEN ? '<REDACTED>' : 'Oh no, this should not be missing.'}`
)
return VITE_KC_DEV_TOKEN
}