-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
6 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,13 +33,11 @@ const RegistrationPage = () => { | |
console.error('Token is missing.'); | ||
setRegistrationError('token'); | ||
// return; //TODO Display error feedback for user | ||
|
||
} | ||
; | ||
//TODO User feedback needed | ||
if (formData.password !== formData.password2) { | ||
setRegistrationError('passwords do not match') | ||
}; | ||
setRegistrationError('passwords do not match'); | ||
} | ||
try { | ||
const response = await fetch(`/api/users/register?token=${token}`, { | ||
method: 'POST', | ||
|
@@ -50,7 +48,7 @@ const RegistrationPage = () => { | |
}); | ||
const data = await response.json(); | ||
if (!response.ok) { | ||
setRegistrationError('general') | ||
setRegistrationError('general'); | ||
throw new Error(data.message || 'An error occurred during registration.'); | ||
} | ||
|
||
|
@@ -134,13 +132,13 @@ const RegistrationPage = () => { | |
)} | ||
{registrationError === 'general' && ( | ||
<div className="mt-4 text-red-500 text-center"> | ||
Sorry! It's not you - it's us. We are unable to register you at this time. Please | ||
Sorry! It is not you - it is us. We are unable to register you at this time. Please | ||
e-mail [email protected] for assistance. | ||
</div> | ||
)} | ||
{registrationError === 'passwords do not match' && ( | ||
<div className="mt-4 text-red-500 text-center"> | ||
Passwords do not match. Please try again. | ||
Passwords do not match. Please try again. | ||
</div> | ||
)} | ||
</form> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters