You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
denniscalazans
changed the title
Implicit return in auth0-spa-js/src/cache /cache-manager.ts
Implicit return in auth0-spa-js/src/cache /cache-manager.ts when TS "noImplicitReturns" is set to true
Jun 21, 2024
I'm having the same problem. We've implemented our own ICache, and configured that in Auth0.config.cache. That seems to cause it, reverting back and using the default 'memory' or 'localstorage' option does not cause this error to occur.
Was caused by a direct import from @auth0/auth0-spa-js/src/cache/shared instead of @auth0/auth0-spa-js in our repo.
The MaybePromise return type is not re-exported by @auth0/auth0-angular, so that might be why some people are running into this problem when implementing their own Cache. I think some editors will attempt to directly import that type from @auth0/auth0-spa-js/src/cache/shared when @auth0/auth0-spa-js is not in the package.json, because it is a dependency of @auth0/auth0-angular.
Checklist
Description
private async getCacheKeys(): Promise<string[] | undefined> {
if (this.keyManifest) {
return (await this.keyManifest.get())?.keys;
} else if (this.cache.allKeys) {
return this.cache.allKeys();
}
}
Reproduction
Install Auth0 library
npm i --save @auth0/auth0-spa-js
Make use of it
npm run build the angular project
Additional context
No response
auth0-spa-js version
2.1.3
Which framework are you using (React, Angular, Vue...)?
Angular
Framework version
17
Which browsers have you tested in?
Other
The text was updated successfully, but these errors were encountered: