-
Notifications
You must be signed in to change notification settings - Fork 614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send user type on authenticateUser #4335
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't query the database two times at the same line. Just take a look at the comments.
@@ -365,7 +365,7 @@ public Result authenticateUser(User user) | |||
session.setAttribute(IS_AUTHENTICATED, true); | |||
session.setAttribute(USER_EMAIL, user.getEmail()); | |||
session.setAttribute(USER_PASSWORD, getMD5Hash(user.getPassword())); | |||
message = getDataStore().getUser(user.getEmail()).getScope(); | |||
message = getDataStore().getUser(user.getEmail()).getScope() + "/" + getDataStore().getUser(user.getEmail()).getUserType(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't query the database two times at the following line
message = getDataStore().getUser(user.getEmail()).getScope() + "/" + getDataStore().getUser(user.getEmail()).getUserType();
Do something like that
user = getDataStore().getUser(user.getEmail());
message = user.getScope() + "/" + user.getUserType();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I will change this line
Note: This pr should be merged with ant-media/Ant-Media-Management-Console#182 |
Kudos, SonarCloud Quality Gate passed! |
#4295