Skip to content

Commit

Permalink
sign_up/sign_in: avoid email verification
Browse files Browse the repository at this point in the history
this is already done on the server side, and the regular expression we have here
is not correct.
  • Loading branch information
hannesm committed Aug 13, 2024
1 parent dfa9f12 commit a2fa8a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 30 deletions.
16 changes: 1 addition & 15 deletions sign_in.ml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ let login_page ~icon () =
];
]
();
p ~a:[ a_id "email-alert" ] [];
];
div
[
Expand Down Expand Up @@ -206,17 +205,14 @@ let login_page ~icon () =
\ loginButton.addEventListener('click', async \
function() {\n\
\ const email = \
document.getElementById('email').value.toLowerCase()\n\
document.getElementById('email').value\n\
\ const password = \
document.getElementById('password').value\n\
\ let form_alert = \
document.getElementById('form-alert')\n\
\ let email_alert = \
document.getElementById('email-alert')\n\
\ let password_alert = \
document.getElementById('password-alert')\n\
\ form_alert.classList.add('hidden')\n\
\ email_alert.classList.add('hidden')\n\
\ password_alert.classList.add('hidden')\n\
\ if (!email || !password) {\n\
\ form_alert.classList.remove('hidden')\n\
Expand All @@ -226,16 +222,6 @@ let login_page ~icon () =
required'\n\
\ return;\n\
\ }\n\
\ const emailPattern = \
/^[a-zA-Z0-9.$_!]+@[a-zA-Z0-9]+\\.[a-z]{2,3}$/;\n\
\ if (!emailPattern.test(email)) {\n\
\ email_alert.classList.remove('hidden')\n\
\ \
email_alert.classList.add('text-secondary-500', 'block')\n\
\ email_alert.textContent = 'Please enter \
a valid email address.'\n\
\ return;\n\
\ }\n\
\ if (password.length < 8) {\n\
\ password_alert.classList.remove('hidden')\n\
\ \
Expand Down
16 changes: 1 addition & 15 deletions sign_up.ml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ let register_page ~icon () =
];
]
();
p ~a:[ a_id "email-alert" ] [];
];
div
[
Expand Down Expand Up @@ -247,20 +246,17 @@ let register_page ~icon () =
\ const name = \
document.getElementById('name').value\n\
\ const email = \
document.getElementById('email').value.toLowerCase()\n\
document.getElementById('email').value\n\
\ const password = \
document.getElementById('password').value\n\
\ let form_alert = \
document.getElementById('form-alert')\n\
\ let name_alert = \
document.getElementById('name-alert')\n\
\ let email_alert = \
document.getElementById('email-alert')\n\
\ let password_alert = \
document.getElementById('password-alert')\n\n\
\ form_alert.classList.add('hidden')\n\
\ name_alert.classList.add('hidden')\n\
\ email_alert.classList.add('hidden')\n\
\ password_alert.classList.add('hidden')\n\n\
\ if (!name || !email || !password) {\n\
\ form_alert.classList.remove('hidden')\n\
Expand All @@ -278,16 +274,6 @@ let register_page ~icon () =
at least 4 characters.'\n\
\ return;\n\
\ }\n\n\
\ const emailPattern = \
/^[a-zA-Z0-9.$_!]+@[a-zA-Z0-9]+\\.[a-z]{2,3}$/;\n\
\ if (!emailPattern.test(email)) {\n\
\ email_alert.classList.remove('hidden')\n\
\ \
email_alert.classList.add('text-secondary-500', 'block')\n\
\ email_alert.textContent = 'Please \
enter a valid email address.'\n\
\ return;\n\
\ }\n\n\
\ if (password.length < 8) {\n\
\ \
password_alert.classList.remove('hidden')\n\
Expand Down

0 comments on commit a2fa8a6

Please sign in to comment.