aboutsummaryrefslogtreecommitdiff
path: root/modern/src/login/RegisterPage.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/login/RegisterPage.jsx')
-rw-r--r--modern/src/login/RegisterPage.jsx4
1 files changed, 3 insertions, 1 deletions
diff --git a/modern/src/login/RegisterPage.jsx b/modern/src/login/RegisterPage.jsx
index cffed803..4e2a05e1 100644
--- a/modern/src/login/RegisterPage.jsx
+++ b/modern/src/login/RegisterPage.jsx
@@ -56,7 +56,8 @@ const RegisterPage = () => {
}
}, [totpForce, setTotpKey]);
- const handleSubmit = useCatch(async () => {
+ const handleSubmit = useCatch(async (event) => {
+ event.preventDefault();
const response = await fetch('/api/users', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
@@ -124,6 +125,7 @@ const RegisterPage = () => {
variant="contained"
color="secondary"
onClick={handleSubmit}
+ type="submit"
disabled={!name || !password || !(server.newServer || /(.+)@(.+)\.(.{2,})/.test(email))}
fullWidth
>