Skip to content
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

Merged
merged 3 commits into from
Aug 23, 2022
Merged

Send user type on authenticateUser #4335

merged 3 commits into from
Aug 23, 2022

Conversation

mustafaboleken
Copy link
Contributor

Copy link
Contributor

@mekya mekya left a 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();
Copy link
Contributor

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();

Copy link
Contributor Author

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

@mustafaboleken
Copy link
Contributor Author

Note: This pr should be merged with ant-media/Ant-Media-Management-Console#182

@sonarcloud
Copy link

sonarcloud bot commented Aug 22, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@mekya mekya merged commit e1d7d18 into master Aug 23, 2022
@mekya mekya deleted the fix/issue-4295 branch August 23, 2022 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants