Skip to content
This repository has been archived by the owner on Dec 14, 2017. It is now read-only.

Bug in error logging within configureAutoRenewToken() #189

Closed
pinnprophead opened this issue Oct 27, 2015 · 3 comments
Closed

Bug in error logging within configureAutoRenewToken() #189

pinnprophead opened this issue Oct 27, 2015 · 3 comments
Assignees

Comments

@pinnprophead
Copy link

configureAutoRenewToken() function contains

console.error(console.error(e.message || e);

In some cases e is undefined, so an error is thrown
"Uncaught (in promise) TypeError: Cannot read property 'message' of undefined(…)"

Suggest:
var msg = 'unknown error in renewTokenSilentAsync()';
if (e) {
if (e.message) {
msg = e.message;
} else {
msg = e;
}
}
console.error(msg);

Or something that protects e being undefined.

console.error(e ? (e.message ? e.message : e) : 'unknown error in confugureAutoRenewToken()');

would be the shortest version.

PS: I encountered this situation (of an empty error object) when attempting to renew access token using the javascript implicit client, and the "silent_renew.html" page was not specified as a valid callback url in identityServer.

@brockallen
Copy link
Member

Is this in the callback in the html or in the JS library itself?

@pinnprophead
Copy link
Author

It is about line 829 in oidc.js -- function configureAutoRenewToken(mgr)

@brockallen
Copy link
Member

Moved to the oidc-client repo.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants