1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-16 00:14:34 +02:00

Desktop: Add an option to renew the API token (#4811)

This commit is contained in:
Helmut K. C. Tessarek
2021-04-07 14:27:16 -04:00
committed by GitHub
parent e3efe70bab
commit 2fc9c53ff0
3 changed files with 26 additions and 2 deletions

View File

@ -254,6 +254,10 @@ export default class EncryptionService {
// sjcl.random.addEntropy(hexSeed, 1024, 'shim.randomBytes');
// }
async generateApiToken() {
return await this.randomHexString(64);
}
async randomHexString(byteCount: number) {
const bytes: any[] = await shim.randomBytes(byteCount);
return bytes