Ma77Ball commented on code in PR #6402:
URL: https://github.com/apache/texera/pull/6402#discussion_r3607785305


##########
amber/src/main/scala/org/apache/texera/web/resource/auth/AuthResource.scala:
##########
@@ -103,13 +103,14 @@ class AuthResource {
   @Path("/register")
   def register(request: UserRegistrationRequest): TokenIssueResponse = {
     val username = request.username
+    val useremail = request.email
     if (username == null) throw new NotAcceptableException("Username cannot be 
null.")

Review Comment:
   I recommend mirroring the username validation here: 
   
   ```suggestion
       if (username.trim.isEmpty) throw new NotAcceptableException("Username 
cannot be empty.")
       if (useremail == null || useremail.trim.isEmpty)
         throw new NotAcceptableException("Email cannot be empty.")
   ```



##########
frontend/src/app/hub/component/about/local-login/local-login.component.html:
##########
@@ -34,6 +34,12 @@
       <ng-container *ngIf="control.hasError('required')">Please confirm your 
password. </ng-container>
       <ng-container *ngIf="control.hasError('confirm')">Two passwords are 
inconsistent. </ng-container>
     </ng-template>
+    <ng-template
+      #emailErrorTip
+      let-control>
+      <ng-container *ngIf="control.hasError('optional')">Please input your 
email. </ng-container>

Review Comment:
   Setting this to optional would cause the "Please input your email." tip to 
never render when the field is empty. I recommend using required here: 
   
   ```suggestion
         <ng-container *ngIf="control.hasError('required')">Please input your 
email. </ng-container>
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to