Création d'un composable pour la gestion de la crypto, mise en place de l'initialisation de la première liste et sauvegarde de celle-ci. TODO NEXT : Récupération de la liste en la déchiffrant, mise en place d'une masterKey dérivée du mot de passe pour les utilisateurs non google, basculement vers la page des listes après connexion google etc.

This commit is contained in:
2026-03-15 08:15:42 +01:00
parent d9d84634e8
commit 5d582461e2
10 changed files with 562 additions and 29 deletions

View File

@@ -1,5 +1,5 @@
import type { $Fetch } from 'ofetch';
import type { List } from '~/types/lists'
import type { List, WPListEncrypted } from '~/types/lists'
export default class ListRepository {
private fetcher: $Fetch;
@@ -17,6 +17,23 @@ export default class ListRepository {
method: 'POST',
body: data
});
}
async uploadKeys(data: string) {
console.log('uploadEncryptedPrivateKey : data is')
console.log(data)
return await this.fetcher<any>('/lists/PrivKeyCipher', {
method: 'POST',
body: data
})
}
async update(data: WPListEncrypted) {
const string = JSON.stringify(data);
return await this.fetcher<any>('/lists/' + data.id, {
method: 'PUT',
body: string
})
}
}