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

[Bug] Disabled users are able to login #264

Merged
merged 1 commit into from
Jan 18, 2025

Conversation

arshadmohammad
Copy link
Collaborator

Purpose of this pull request

Check list

@arshadmohammad
Copy link
Collaborator Author

The functionality has been verified through integration testing.
Screenshot from 2025-01-15 00-44-42

@@ -32,8 +32,8 @@ public enum SeatunnelErrorEnum {

USERNAME_PASSWORD_NO_MATCHED(
10007,
"username and password no matched",
"The user name and password do not match, please check your input"),
"username and password no matched or user is disabled.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix the typo,

Suggested change
"username and password no matched or user is disabled.",
"username and password not matched or user is disabled."

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing message had the typo. I retained the same message initially, but it can be corrected. I have now corrected it.

@@ -94,7 +94,7 @@
select
<include refid="Base_Column_List"/>
from `user`
where username = #{username,jdbcType=VARCHAR} and password = #{password,jdbcType=VARCHAR}
where status = 0 and username = #{username,jdbcType=VARCHAR} and password = #{password,jdbcType=VARCHAR}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

status=1 semantically makes sense for a user to be enabled, 0 should be considered disabled. Can we please check, what changes would be required for the same?

we can revisit UserServiceImpl#add

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how currently user status is stored in the database. In my opinion, reversing the status code does not constitute a significant code improvement. Therefore, I prefer to maintain the existing approach.

@arshadmohammad
Copy link
Collaborator Author

image

Copy link
Member

@Hisoka-X Hisoka-X left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arshadmohammad arshadmohammad merged commit a901300 into apache:main Jan 18, 2025
15 checks passed
@arshadmohammad
Copy link
Collaborator Author

Thanks @shashwatsai , @Hisoka-X for review.

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.

3 participants