Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
storage.set('is_authenticated', {}, error => {
keytar.deletePassword('cern-phone-app', 'access_token');
keytar.deletePassword('cern-phone-app', 'refresh_token');
keytar.deletePassword('cern-phone-app', 'tone_token');
if (error) {
console.log(`Error is_authenticated: ${error}`);
}
if (!authWindow) {
createAuthWindow();
}
if (mainWindow) {
mainWindow.destroy();
}
});
}
'api/request',
{
url: '/v1/oauth/revoke',
method: 'post',
data: {
client_id: state.uid,
client_secret: state.secret,
token: state.accessToken
}
},
{ root: true }
);
} catch (e) {
dispatch('toast/error', e, { root: true });
}
await keytar.deletePassword(state.service, state.uid);
commit(CLEAR_ACCESS_TOKEN);
},
async restoreAccessToken({ state, commit }, url) {
deleteToken () {
const tokenResult = keytar.deletePassword(KEYCHAIN_SERVICE_NAME, KEYCHAIN_ACCOUNT)
this.emitter.emit('did-delete-token')
return tokenResult
}
revokeTeam: function(teamName) {
delete _authTokens[teamName]
keytar.deletePassword("Tomatoad_Slack", teamName)
},
async removeCredential(exchange) {
return keytar.deletePassword(APP_NAME, exchange);
},
};
static deleteToken() {
keytar.deletePassword(SERVICE, ACCOUNT)
if (isTest) {
storage.delete(KEY)
}
}
function updateCert(host, port, cert) {
const account = getAccountNameForCert(host, port);
if (cert) {
return keytar.setPassword(SERVICE_NAME, account, cert);
} else {
return keytar.deletePassword(SERVICE_NAME, account);
}
}
const mainDeleteCredentials = username => {
return keytar.deletePassword(CONSTANTS.APP, username);
};
ipcMain.on(`credentials-remove-${id}`, async (e, data: IFormFillData) => {
const { _id, fields } = data;
const view = appWindow.viewManager.selected;
await storage.remove({
scope: 'formfill',
query: {
_id,
},
});
await deletePassword('wexond', `${view.hostname}-${fields.username}`);
appWindow.viewManager.settingsView.webContents.send(
'credentials-remove',
_id,
);
});