Use different location for token depending on build type

Summary:
For Electron builds, use the same directory as certificates and keys.

For headless builds, then use the static directory.

Reviewed By: antonk52

Differential Revision: D45728515

fbshipit-source-id: 55a3b143a9289fed23e57cbf6b701a5e48d27332
This commit is contained in:
Lorenzo Blasa
2023-05-10 04:35:17 -07:00
committed by Facebook GitHub Bot
parent b94f6b6152
commit fdd1a9e887

View File

@@ -271,8 +271,12 @@ const getStaticFilePath = (filename: string): string => {
const tokenFilename = 'auth.token';
const getTokenPath = (): string => {
const path = getStaticFilePath(tokenFilename);
return path;
const config = getFlipperServerConfig();
if (config.environmentInfo.isHeadlessBuild) {
return getStaticFilePath(tokenFilename);
}
return getFilePath(tokenFilename);
};
export const generateAuthToken = async () => {