Jacob O'Donnell

Results 12 comments of Jacob O'Donnell

version 3.4.5 `{ "compilerOptions": { "target": "es5", "lib": [ "dom", "dom.iterable", "esnext" ], "allowJs": true, "skipLibCheck": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "strict": true, "forceConsistentCasingInFileNames": true, "module": "esnext", "moduleResolution": "node", "resolveJsonModule":...

`import { CacheLocation } from "react-aad-msal";` `cacheLocation: ("localStorage" as CacheLocation),` this works. i think this is because type widening, the cacheLocation key "localStorage" is widenened to type string so you...

Hi @AndrewCraswell , this definitely seems like type widening to me, as this also works for me: ``` const cacheLocation: 'localStorage' = 'localStorage'; const config = { auth: { authority:...

the documentation looks good to me, but i suppose you could take your pick from these alternative syntaxes as well. personally i don't think i see any clarity benefits of...

``` enum CacheStorage { LocalStorage = "localStorage", SessionStorage = "sessionStorage" } ........ const config = { auth: { authority: (process.env.REACT_APP_AUTHORITY as string), clientId: (process.env.REACT_APP_AAD_APP_CLIENT_ID as string), }, cache: { cacheLocation:...

seems like at some point this will make it through to msal https://github.com/AzureAD/microsoft-authentication-library-for-js/pull/851

Awesome, thank you. > On Jul 23, 2019, at 11:34 AM, Sameera Gajjarapu wrote: > > Merged to dev today, we are releasing a patch sometime soon, the release should...

Ugh, sorry @AndrewCraswell, but the change got reverted. https://github.com/AzureAD/microsoft-authentication-library-for-js/pull/851

@scottyh527 this error is specific to typescript, if you aren't using typescript then you aren't getting the same error. what are you seeing exactly?

assuming your are using typescript though you can try cacheLocation: ("localStorage" as "localStorage"), this forces the type of the string to be the string "localStorage" and not ANY string.