Auth0-spa-js: Incorrect typing for getUser and ICache.get

Created on 3 Dec 2020  路  1Comment  路  Source: auth0/auth0-spa-js

https://github.com/auth0/auth0-spa-js/blob/7a25483e569bf72f0ff1be3eb196077fe16bb7d0/src/Auth0Client.ts#L416

Judging by the last line, if there's no cache value we will not get a User returned. Instead it will be undefined.

Relatedly, ICache#get should also have undefined as a possible return value: https://github.com/auth0/auth0-spa-js/blob/7a25483e569bf72f0ff1be3eb196077fe16bb7d0/src/cache.ts#L72.

bug report

Most helpful comment

Thanks for raising @wagenet, I'll put a fix in for this as part of #661

>All comments

Thanks for raising @wagenet, I'll put a fix in for this as part of #661

Was this page helpful?
0 / 5 - 0 ratings