Ajoute le routeur et la page d'instanciation de la phrase de passe

This commit is contained in:
2022-03-01 14:10:13 +01:00
parent c2b60b4b6a
commit a8116aa5a2
12 changed files with 5919 additions and 171 deletions

View File

@@ -24,15 +24,19 @@ export default function FirstPage() {
encryptStorage = new EncryptStorage(passphrase);
encryptStorage.encrypt("checkword", word);
let encryptedFormData = new FormData();
encryptedFormData.append("checkword", ""+localStorage.getItem("key"));
encryptedFormData.append("checkword", ""+localStorage.getItem("checkword"));
encryptedFormData.append('_token', csrf);
let response = await fetch(url, {
const response = await fetch(url, {
method: 'POST',
body: encryptedFormData
});
const json = await response.json(); // TODO redirect if success
if (json.success) {
location.href = "/diary/public/pages"
}
};
const updatePassphrase = (e: React.ChangeEvent<HTMLInputElement>) => {