2019-08-20 14:29:59 +02:00
|
|
|
import keytar from 'keytar';
|
|
|
|
import { AUTH_ORG } from 'constants/keychain';
|
|
|
|
|
|
|
|
export const setSavedPassword = (key, value) => {
|
|
|
|
keytar.setPassword(AUTH_ORG, key, value);
|
|
|
|
};
|
|
|
|
|
2019-08-26 22:18:30 +02:00
|
|
|
export const getSavedPassword = key => {
|
|
|
|
return keytar
|
|
|
|
.getPassword(AUTH_ORG, key)
|
|
|
|
.then(p => p)
|
|
|
|
.catch(e => console.error(e));
|
|
|
|
};
|
2019-08-20 14:29:59 +02:00
|
|
|
|
2019-08-26 22:18:30 +02:00
|
|
|
export const deleteSavedPassword = key => keytar.deletePassword(AUTH_ORG, key).catch(e => console.error(e));
|