Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Environment.getUserRootDirectory() on Non-Windows Platforms (#6581)
fix: `Environment.getUserRootDirectory()` only ever executes Windows code path From the Azure msal-node [docs](https://github.com/MicrosoftDocs/azure-docs/blob/e622cd3bded2530b8db7843cd9539fd16f0cd67c/articles/active-directory/develop/msal-node-extensions.md?plain=1#L50-L52): ```typescript // You can use the helper functions provided through the Environment class to construct your cache path // The helper functions provide consistent implementations across Windows, Mac and Linux. const cachePath = path.join(Environment.getUserRootDirectory(), "./cache.json"); ``` The existing (broken) code: https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/9934e3b07118403898e65091035d26295e55f128/extensions/msal-node-extensions/src/utils/Environment.ts#L59-L63 msal-node-extensions: `Environment.getUserHomeDirOnUnix()` was never called, because `!this.isWindowsPlatform` would always be false, since `isWindowsPlatform()` is a static method and not a property getter (or property) --------- Signed-off-by: Janusz Dziurzynski <[email protected]>
- Loading branch information