✨ Ajoute le routeur et la page d'instanciation de la phrase de passe
This commit is contained in:
@@ -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>) => {
|
||||
|
Reference in New Issue
Block a user