Added a wait for the token exchange

This commit is contained in:
Glen Maddern 2025-03-31 22:28:10 +11:00
parent 9fbba0509c
commit d5f5b31786
4 changed files with 20 additions and 3 deletions

View file

@ -169,11 +169,15 @@ export async function readJsonFile<T>(
const filePath = getConfigFilePath(serverUrlHash, filename)
const content = await fs.readFile(filePath, 'utf-8')
return await schema.parseAsync(JSON.parse(content))
const result = await schema.parseAsync(JSON.parse(content))
// console.log({ filename: result })
return result
} catch (error) {
if ((error as NodeJS.ErrnoException).code === 'ENOENT') {
// console.log(`File ${filename} does not exist`)
return undefined
}
log(`Error reading ${filename}:`, error)
return undefined
}
}