-
Notifications
You must be signed in to change notification settings - Fork 40
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
Draft: User cannot login if previous user did not logout #1455
base: develop
Are you sure you want to change the base?
Draft: User cannot login if previous user did not logout #1455
Conversation
105ca78
to
59c81a6
Compare
test/test_authn.py
Outdated
# Test against proposal-based authentication only | ||
@pytest.mark.parametrize("login_type", ["proposal"], indirect=True) | ||
def test_authn_different_proposal(make_client): | ||
"""Test two users for different proposals. |
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.
So this is not actually testing for different proposals, its testing two users with the same proposal
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.
ok, I will cherry pick from develop for this piece
and "Commissioning" in proposal_info["Proposal"]["title"] | ||
): | ||
if hasattr(HWR.beamline.session, "set_in_commissioning"): | ||
if proposal_info: |
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.
Was it these lines that caused the issue ?
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.
the issue was TypeError (if proposal_info was None) or KeyError raised here:
and Commissioning" in proposal_info["Proposal"]["title"]
instead of returning False at the end, and finally it was carried and re-raised here: https://github.com/mxcube/mxcubeweb/blob/develop/mxcubeweb/routes/login.py#L43
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.
...user already appeared as active (https://github.com/mxcube/mxcubeweb/blob/develop/mxcubeweb/core/components/user/usermanager.py#L343)
I see, the first comment above threw me off a bit. So I imagine that this is with user based login ? Out of curiosity how come that proposal_info
was None ?
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.
sorry for my mistake - it was some time ago I was debugging that, the error raised here was KeyError caused by 1st or 2nd keyword, and of course proposal_info may be an empty dict, not None
Hi @dominikatrojanowska and @fabcor-maxiv Where in the PR is the actual issue solved ? |
So If understand this correctly the issue you are facing is that you can't login with two different users belonging to the same proposal/session ? |
@dominikatrojanowska: As we mentioned before, I suggest that you try this use case with the |
Depends on: mxcube/mxcubecore#1066
KeyError regarding Proposal was blocking effective log in in case of:
When, so called, another user logged out, the login (by pressing Sign in button on login page) of current user was still impossible because the current user already appeared as active (https://github.com/mxcube/mxcubeweb/blob/develop/mxcubeweb/core/components/user/usermanager.py#L343)
Log in was possible when the another user logs out and instead of clicking Sign in button the session was refreshed.