Mrudhulraj commented on code in PR #6402:
URL: https://github.com/apache/texera/pull/6402#discussion_r3641712891
##########
amber/src/main/scala/org/apache/texera/web/resource/auth/AuthResource.scala:
##########
@@ -102,22 +102,34 @@ class AuthResource {
@POST
@Path("/register")
def register(request: UserRegistrationRequest): TokenIssueResponse = {
- val username = request.username
- if (username == null) throw new NotAcceptableException("Username cannot be
null.")
- if (username.trim.isEmpty) throw new NotAcceptableException("Username
cannot be empty.")
- userDao.fetchByName(username).size() match {
- case 0 =>
+ val username = Option(request.username).getOrElse("").trim
+ val useremail = Option(request.email).getOrElse("").trim
+ val userpassword = request.password
+ if (username.isEmpty)
+ throw new NotAcceptableException("Username cannot be empty")
+ if (useremail.isEmpty)
+ throw new NotAcceptableException("Email cannot be empty")
+ if (userpassword == null || userpassword.isEmpty)
+ throw new NotAcceptableException("Password cannot be empty")
Review Comment:
Addressed this issue in the latest patch.
--
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]