Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (httpProvider && httpProvider.interceptors) {
httpProvider.interceptors.push('ProtectedResourceInterceptor');
}
// create instance with given config
_msal = new Msal.UserAgentApplication(configOptions.clientID, configOptions.authority, configOptions.tokenReceivedCallback, configOptions.optionalParams);
if (configOptions.routeProtectionConfig) {
_msal.routeProtectionConfig = configOptions.routeProtectionConfig;
}
else {
_msal.routeProtectionConfig = {};
}
_msal.loginScopes = [_msal.clientId];
_constants = Msal.Constants;
} else {
throw new Error('You must set configOptions, when calling init');
}
// loginResource is used to set authenticated status
updateDataFromCache(_msal.loginScopes);
};