Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private async _getCredentials() {
try {
const credentials = await Credentials.get();
if (!credentials) return null;
logger.debug('set credentials for analytics', credentials);
return Credentials.shear(credentials);
} catch (err) {
logger.debug('ensure credentials error', err);
return null;
}
}
}
.then(credentials => {
if (!credentials) return false;
const cred = Credentials.shear(credentials);
logger.debug('set credentials for storage', cred);
this._config.credentials = cred;
return true;
})
.catch(err => {
.then(credentials => {
if (!credentials) return false;
const cred = Credentials.shear(credentials);
logger.debug('set credentials for api', cred);
return true;
})
.catch(err => {
.then(credentials => {
if (!credentials) return false;
const cred = Credentials.shear(credentials);
logger.debug('set credentials for api', cred);
return true;
})
.catch(err => {
.then(credentials => {
if (!credentials) return null;
logger.debug('set credentials for analytics', this._config.credentials);
return Credentials.shear(credentials);
})
.catch(err => {
.then(credentials => {
if (!credentials) return false;
const cred = Credentials.shear(credentials);
logger.debug('set credentials for api', cred);
return true;
})
.catch(err => {
.then(credentials => {
if (!credentials) return null;
logger.debug('set credentials for analytics', that._config.credentials);
return Credentials.shear(credentials);
})
.catch(err => {
.then(credentials => {
if (!credentials) return false;
const cred = Credentials.shear(credentials);
logger.debug('set credentials for api', cred);
return true;
})
.catch(err => {