From f145897ce83a728a35b9937cd69ae293fc42f868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Andr=C3=A1s=20Horv=C3=A1th?= Date: Sun, 18 Jun 2023 10:44:36 +0200 Subject: [PATCH 1/2] Remove lost code button MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás András Horváth --- pages/azonositas.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/azonositas.js b/pages/azonositas.js index 566be89..e5db933 100644 --- a/pages/azonositas.js +++ b/pages/azonositas.js @@ -250,7 +250,7 @@ function AuthPage() {
- Nincs meg a kódom + {/* Nincs meg a kódom */}
From 65bdbe8d237536d110a010d03e204ccbb19fd777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Andr=C3=A1s=20Horv=C3=A1th?= Date: Sun, 18 Jun 2023 10:50:08 +0200 Subject: [PATCH 2/2] Remove e-mail address check page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tamás András Horváth --- pages/e-mail-cim-megadasa.js | 189 ----------------------------------- 1 file changed, 189 deletions(-) delete mode 100644 pages/e-mail-cim-megadasa.js diff --git a/pages/e-mail-cim-megadasa.js b/pages/e-mail-cim-megadasa.js deleted file mode 100644 index 8fe085d..0000000 --- a/pages/e-mail-cim-megadasa.js +++ /dev/null @@ -1,189 +0,0 @@ -import React, { useEffect, useState, useContext } from 'react' -import getConfig from 'next/config' -import { useRouter } from 'next/router' -import { ReCaptcha, loadReCaptcha } from 'react-recaptcha-v3' -import axios from "axios" -import Modal from 'react-modal' -import StoreContext from '../src/StoreContext' -import HeaderForgotSection from '../src/section/HeaderForgotSection' -import Submit from "../src/component/form/elements/Submit" -import InputText from "../src/component/form/elements/InputText" -import Checkbox from "../src/component/form/elements/Checkbox" -import ScrollTo from "../src/component/common/ScrollTo" -import Error from "../src/component/form/Error" -import ErrorMiniWrapper from "../src/component/form/ErrorMiniWrapper" -import { rmAllCharForEmail, rmAllCharForName } from '../src/lib/removeSpecialCharacters' - -Modal.setAppElement('body'); - -function EmailPage() { - const context = useContext(StoreContext) - const router = useRouter() - - const { publicRuntimeConfig } = getConfig() - - const [loading, setLoading] = useState(false) - const [recaptcha, setRecaptcha] = useState(null) - const [recaptchaToken, setRecaptchaToken] = useState('') - const [scroll, setScroll] = useState(false) - const [error, setError] = useState(null) - const [filterData, setFilterData] = useState({ - 'email': '', - 'privacy': false, - }) - - useEffect(() => { - loadReCaptcha(publicRuntimeConfig.siteKey, (recaptchaToken) => { - setRecaptchaToken(recaptchaToken) - }) - }, []) - - const clearErrorItem = (inputName) => { - if (error && error[inputName]) { - delete error[inputName] - } - } - - const handleChangeEmailInput = (e) => { - clearErrorItem(e.target.name) - - setFilterData({ ...filterData, [e.target.name]: rmAllCharForEmail(e.target.value) }) - } - - const handleChangeInput = (e) => { - clearErrorItem(e.target.name) - - if (e.target.name === 'privacy' || e.target.name === 'newsletter') { - clearErrorItem('privacy') - clearErrorItem('newsletter') - } - - const value = e.target.type === 'checkbox' ? e.target.checked : rmAllCharForName(e.target.value) - - setFilterData({ ...filterData, [e.target.name]: value }) - } - - const submitAuth = (e) => { - e.preventDefault() - - if (loading) { - return - } - - setScroll(false) - setError(null) - setLoading(true) - - const data = { - ...filterData, - 'g-recaptcha-response': recaptchaToken, - } - - context.storeSave('form_code', 'data', filterData) - - axios.post( - publicRuntimeConfig.apiEmailRequest, - new URLSearchParams(data).toString() - ) - .then(response => { - if (response.data) { - router.push('/e-mail-cim-megerositese') - } - }) - .catch(error => { - if (error.response && error.response.status === 403) { - setError('Google reCapcha ellenőrzés sikertelen. Kérjük frissíts rá az oldalra.') - setScroll(true) - } else if (error.response && error.response.data && error.response.data.error) { - setError(error.response.data.error) - setScroll(true) - } else if (error.response && error.response.data && error.response.data.errors) { - setError(error.response.data.errors) - setScroll(true) - } else { - setError('Váratlan hiba történt, kérünk próbáld később') - setScroll(true) - } - - recaptcha.execute() - }) - .finally(() => { - setLoading(false) - }) - } - - return ( - <> - - -
- {scroll && document.querySelector('.error-message-inline') ? : null} - -
-
-
-
-
-
-
-

Egyedi azonosító igénylése

-
- -
- {error && } -
- Add meg azt az e-mail címet, amire elküldhetjük a megerősítő linket és a kódodat. - } - info={null} - /> - - -
- - <> -
- - Elolvastam az adatkezelési tájékoztatást, és az abban foglaltakat tudomásul vettem. - -
- - - -
- - setRecaptcha(ref)} - sitekey={publicRuntimeConfig.siteKey} - action="submit" - verifyCallback={(recaptchaToken) => { - setRecaptchaToken(recaptchaToken) - }} - /> - -
- - Mégse -
-
-
-
-
-
-
-
-
- - ) -} - -export default EmailPage