You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-30 23:44:55 +02:00
23 lines
752 B
TypeScript
23 lines
752 B
TypeScript
![]() |
import KeychainServiceDriverBase from './KeychainServiceDriverBase';
|
||
|
import shim from '../../shim';
|
||
|
|
||
|
export default class KeychainServiceDriver extends KeychainServiceDriverBase {
|
||
|
|
||
|
async setPassword(name:string, password:string):Promise<boolean> {
|
||
|
if (!shim.keytar()) return false;
|
||
|
await shim.keytar().setPassword(`${this.appId}.${name}`, `${this.clientId}@joplin`, password);
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
async password(name:string):Promise<string> {
|
||
|
if (!shim.keytar()) return null;
|
||
|
return shim.keytar().getPassword(`${this.appId}.${name}`, `${this.clientId}@joplin`);
|
||
|
}
|
||
|
|
||
|
async deletePassword(name:string):Promise<void> {
|
||
|
if (!shim.keytar()) return;
|
||
|
await shim.keytar().deletePassword(`${this.appId}.${name}`, `${this.clientId}@joplin`);
|
||
|
}
|
||
|
|
||
|
}
|