Open Karim-C opened 6 years ago
@Karim-C Very-small?
@softeng-701 I had a closer look at the issue. Yes, It could be labeled very-small. The solution is not immediately obvious it will likely be more than just editing a String. The Exception with the message "not a well-formed email address" seems to be thrown by a library so this will have to be caught and processed or the "not well-formed email address" has to be identified beforehand.
@softeng-701 is there any thing else you need to know about the issue before it is approved?
On the registration page, when entering an email which is not well formed the user does not get an informative error message. The error message should advise the user that the email is not well-formed. At the moment the user is only told that something is wrong and to try again later which is misleading. The error message currently is: “Registration failed! Please try again later.”
Steps to reproduce:
The following is debug output from when the NotValidException is thrown:
NotValidException: Validation failed for argument at index 0 in method: public org.springframework.http.ResponseEntity org.project36.qualopt.web.rest.AccountResource.registerAccount(org.project36.qualopt.web.rest.vm.ManagedUserVM), with 1 error(s): [Field error in object 'managedUserVM' on field 'email': rejected value [not-a-valid-email]; codes [Email.managedUserVM.email,Email.email,Email.java.lang.String,Email]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [managedUserVM.email,email]; arguments []; default message [email],[Ljavax.validation.constraints.Pattern$Flag;@5f1a2fbe,org.springframework.validation.beanvalidation.SpringValidatorAdapter$ResolvableAttribute@6158809f]; default message [not a well-formed email address]]
It appears that the email validity is already being check based on whether there is a character before and after the @ symbol. This issue may have some dependency on issue #14.
@softeng-701 this issue looks as if it will be small. The application already identifies that the format of the email is incorrect, so all that needs to be done is to ensure that a useful error message is shown to the user.