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

Bugfix: pgAdmin imports servers to the wrong accounts in the server version with webserver auth enabled #6818

Closed
wants to merge 3 commits into from

Conversation

konradziczek
Copy link

Closes #6815

user = user.email

new_user = User.query.filter_by(email=user).first()
if user.email:
Copy link
Contributor

Choose a reason for hiding this comment

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

pgAdmin supports multiple authentication at a time, so it is possible to have same email ids and usernames for multiple users.
So you have to check for username + Authentication source combination to get the valid user.

Copy link
Author

Choose a reason for hiding this comment

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

@khushboovashi I have made changes :)

Copy link
Author

Choose a reason for hiding this comment

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

I just didn't know what to do with email because the function accepts text or a user object. So for an object I check auth_source+username, but for text I check email.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am proposing to introduce auth_source as a user input while importing the server itself. So, you need change in setup.py itself. The fix you did does not resolve the issue.

Copy link
Author

Choose a reason for hiding this comment

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

Sorry, I don't know pgadmin code at all. I tried to solve the problem, but I don't know if I can help more. Can you explain in more detail what we want to achieve? What should be changed in the file https://github.com/pgadmin-org/pgadmin4/blob/master/web/setup.py? What do you mean by user input?

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.

pgAdmin imports servers to the wrong accounts in the server version with webserver auth enabled
3 participants