From 689a647b803ffcc7e10364109b83f5f2ffca0c61 Mon Sep 17 00:00:00 2001 From: spencerwooo Date: Fri, 31 Dec 2021 12:28:33 +0800 Subject: [PATCH] fixed file name for serverless persistent store --- utils/odAuthTokenStore.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/odAuthTokenStore.ts b/utils/odAuthTokenStore.ts index 462d701..1a360d5 100644 --- a/utils/odAuthTokenStore.ts +++ b/utils/odAuthTokenStore.ts @@ -1,11 +1,14 @@ // This should be only used on the server side, where the tokens are stored with KV store using // a file system based storage. The tokens are stored in the file system as JSON at /tmp path. +import os from 'os' import Keyv from 'keyv' import { KeyvFile } from 'keyv-file' const kv = new Keyv({ - store: new KeyvFile(), + store: new KeyvFile({ + filename: `${os.tmpdir()}/od-auth-token.json`, + }), }) export async function storeOdAuthTokens({