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:
committed by
Facebook GitHub Bot
parent
b94f6b6152
commit
fdd1a9e887
@@ -271,8 +271,12 @@ const getStaticFilePath = (filename: string): string => {
|
|||||||
|
|
||||||
const tokenFilename = 'auth.token';
|
const tokenFilename = 'auth.token';
|
||||||
const getTokenPath = (): string => {
|
const getTokenPath = (): string => {
|
||||||
const path = getStaticFilePath(tokenFilename);
|
const config = getFlipperServerConfig();
|
||||||
return path;
|
if (config.environmentInfo.isHeadlessBuild) {
|
||||||
|
return getStaticFilePath(tokenFilename);
|
||||||
|
}
|
||||||
|
|
||||||
|
return getFilePath(tokenFilename);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const generateAuthToken = async () => {
|
export const generateAuthToken = async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user