fix: auto fixes
This commit is contained in:
@ -1,8 +1,5 @@
|
|||||||
import type { Models } from '@kittycad/lib'
|
import type { Models } from '@kittycad/lib'
|
||||||
import {
|
import { VITE_KC_API_BASE_URL, VITE_KC_DEV_TOKEN } from '@src/env'
|
||||||
VITE_KC_API_BASE_URL,
|
|
||||||
VITE_KC_DEV_TOKEN,
|
|
||||||
} from '@src/env'
|
|
||||||
import { assign, fromPromise, setup } from 'xstate'
|
import { assign, fromPromise, setup } from 'xstate'
|
||||||
|
|
||||||
import { COOKIE_NAME, OAUTH2_DEVICE_CLIENT_ID } from '@src/lib/constants'
|
import { COOKIE_NAME, OAUTH2_DEVICE_CLIENT_ID } from '@src/lib/constants'
|
||||||
@ -19,7 +16,6 @@ import {
|
|||||||
} from '@src/lib/withBaseURL'
|
} from '@src/lib/withBaseURL'
|
||||||
import { ACTOR_IDS } from '@src/machines/machineConstants'
|
import { ACTOR_IDS } from '@src/machines/machineConstants'
|
||||||
|
|
||||||
|
|
||||||
const LOCAL_USER: Models['User_type'] = {
|
const LOCAL_USER: Models['User_type'] = {
|
||||||
id: '8675309',
|
id: '8675309',
|
||||||
name: 'Test User',
|
name: 'Test User',
|
||||||
@ -54,9 +50,7 @@ export type Events =
|
|||||||
|
|
||||||
export const TOKEN_PERSIST_KEY = 'TOKEN_PERSIST_KEY'
|
export const TOKEN_PERSIST_KEY = 'TOKEN_PERSIST_KEY'
|
||||||
export const persistedToken =
|
export const persistedToken =
|
||||||
getCookie(COOKIE_NAME) ||
|
getCookie(COOKIE_NAME) || localStorage?.getItem(TOKEN_PERSIST_KEY) || ''
|
||||||
localStorage?.getItem(TOKEN_PERSIST_KEY) ||
|
|
||||||
''
|
|
||||||
export const authMachine = setup({
|
export const authMachine = setup({
|
||||||
types: {} as {
|
types: {} as {
|
||||||
context: UserContext
|
context: UserContext
|
||||||
@ -223,7 +217,9 @@ async function getAndSyncStoredToken(input: {
|
|||||||
token?: string
|
token?: string
|
||||||
}): Promise<string> {
|
}): Promise<string> {
|
||||||
if (VITE_KC_DEV_TOKEN) {
|
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
|
return VITE_KC_DEV_TOKEN
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user