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

This commit is contained in:
Shikiryu committed 2022-03-01 14:10:13 +01:00
1 parent c2b60b4b6a
commit a8116aa5a2
12 files changed
+5919 -171

No files matched your search

+6 -2
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>) => {