Added OS awareness for MSAL token cache path.

This commit is contained in:
2026-02-07 10:03:45 +01:00
parent f5b83e6515
commit 9f57067bfb

View File

@@ -11,11 +11,11 @@ import {
} from "@azure/msal-node-extensions";
async function createPca({ tenantId, clientId }) {
const cachePath = path.join(
Environment.getUserRootDirectory(),
".config/sk-az-tools",
`${clientId}-msal.cache`,
);
const cacheRoot = Environment.isWindowsPlatform()
? path.join(Environment.getUserRootDirectory(), "sk-az-tools")
: path.join(Environment.getUserRootDirectory(), ".config", "sk-az-tools");
const cachePath = path.join(cacheRoot, `${clientId}-msal.cache`);
const persistence = await PersistenceCreator.createPersistence({
cachePath,