Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentWillLoad() {
if (!Auth || typeof Auth.configure !== 'function') {
throw new Error(NO_AUTH_MODULE_FOUND);
}
const { oauth = {} } = Auth.configure({});
// backward compatibility
if (oauth['domain']) {
this.federated.oauthConfig = { ...this.federated.oauthConfig, ...oauth };
} else if (oauth['awsCognito']) {
this.federated.oauthConfig = { ...this.federated.oauthConfig, ...oauth['awsCognito'] };
}
if (oauth['auth0']) {
this.federated.auth0Config = { ...this.federated.auth0Config, ...oauth['auth0'] };
}
}
handleLoad = () => {
// @ts-ignore Property 'auth0' does not exist on type '{}'.
const { oauth = {} } = Auth.configure({});
// @ts-ignore Property 'auth0' does not exist on type '{}'.
const { config = oauth.auth0 } = this;
if (!config) {
logger.debug('Auth0 is not configured');
return;
}
logger.debug('auth0 configuration', config);
if (!this._auth0) {
this._auth0 = new window['auth0'].WebAuth(config);
}
this._auth0.parseHash((err, authResult) => {
if (err) {