wip: native secure store

This commit is contained in:
Phong
2023-10-11 14:46:35 +07:00
parent 2fcbf1987b
commit 3b46e71525
9 changed files with 143 additions and 519 deletions

View File

@@ -1,5 +1,3 @@
import { appConfigDir } from '@tauri-apps/api/path';
import { Stronghold } from '@tauri-apps/plugin-stronghold';
import { useEffect, useState } from 'react';
import { Resolver, useForm } from 'react-hook-form';
import { useNavigate } from 'react-router-dom';
@@ -60,11 +58,6 @@ export function CreateStep2Screen() {
const onSubmit = async (data: { [x: string]: string }) => {
setLoading(true);
if (data.password.length > 3) {
const dir = await appConfigDir();
const stronghold = await Stronghold.load(`${dir}lume.stronghold`, data.password);
if (!db.secureDB) db.secureDB = stronghold;
// save privkey to secure storage
await db.secureSave(pubkey, privkey);