-
Notifications
You must be signed in to change notification settings - Fork 38
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
Show warning on deleting the identity that is currently logged in #1146
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.
I love the branch name!
Looks good to me, and it's a good thing to be able to confirm that the current user is being deleted. Any way for the "user" to be redirected to the login page after this? As currently the person is still able to view the interface, but just as though they have no permissions.
That is a good point, we should invalidate the cache after this to revalidate the users auth. Will add this to this PR. |
108433e
to
3455c27
Compare
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.
3455c27
to
95e9b32
Compare
Good catch! With OIDC users, they get immediately recreated after deletion. Because those type of users can self-register. So the user gets deleted, and the cache invalidated. On the next api request, the user is authenticated as OIDC user and lxd recreates the user. I added some logic to logout oidc if the current user is using oidc and removes themselves to avoid the re-creation. |
…y logged in WD-20336 Signed-off-by: David Edler <david.edler@canonical.com>
95e9b32
to
d318bbe
Compare
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.
LGTM! Though upon clicking "Login with SSO" again on this page, I get redirected back into the UI as the same user as before. However I am unsure as to whether this is a local caching issue or a larger bug/error. Surely a deleted user should no longer have working credentials even if this is cached. Refreshing the page does not fix the problem. Screenshot below (Just normal view of OIDC user with restricted privilieges, attempting to access a project).
@Kxiru that is due to the user being recreated on login. OIDC users will register themselves after successful login. This is per design and should be ok. |
Ah yes, I think I recall you mentioning this. Thanks for assuading my fears! |
Done
Fixes WD-20336
QA
Screenshot