From 9f57067bfbb983ce8dab0fe0810e82f063c59115 Mon Sep 17 00:00:00 2001 From: Slawomir Koszewski Date: Sat, 7 Feb 2026 10:03:45 +0100 Subject: [PATCH] Added OS awareness for MSAL token cache path. --- src/azure/pca-auth.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/azure/pca-auth.js b/src/azure/pca-auth.js index f443212..1e5d1bc 100644 --- a/src/azure/pca-auth.js +++ b/src/azure/pca-auth.js @@ -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,