Added OS awareness for MSAL token cache path.
This commit is contained in:
@@ -11,11 +11,11 @@ import {
|
|||||||
} from "@azure/msal-node-extensions";
|
} from "@azure/msal-node-extensions";
|
||||||
|
|
||||||
async function createPca({ tenantId, clientId }) {
|
async function createPca({ tenantId, clientId }) {
|
||||||
const cachePath = path.join(
|
const cacheRoot = Environment.isWindowsPlatform()
|
||||||
Environment.getUserRootDirectory(),
|
? path.join(Environment.getUserRootDirectory(), "sk-az-tools")
|
||||||
".config/sk-az-tools",
|
: path.join(Environment.getUserRootDirectory(), ".config", "sk-az-tools");
|
||||||
`${clientId}-msal.cache`,
|
|
||||||
);
|
const cachePath = path.join(cacheRoot, `${clientId}-msal.cache`);
|
||||||
|
|
||||||
const persistence = await PersistenceCreator.createPersistence({
|
const persistence = await PersistenceCreator.createPersistence({
|
||||||
cachePath,
|
cachePath,
|
||||||
|
|||||||
Reference in New Issue
Block a user