Skip to content

oidc_auth: guard group removal against out-of-band group deletion#1637

Open
davmlaw wants to merge 1 commit into
masterfrom
hardening/oidc-group-removal-guard
Open

oidc_auth: guard group removal against out-of-band group deletion#1637
davmlaw wants to merge 1 commit into
masterfrom
hardening/oidc-group-removal-guard

Conversation

@davmlaw

@davmlaw davmlaw commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🤖 Written by Claude

When syncing a user's groups at login, the removed-groups branch used Group.objects.get(name=...), which raises Group.DoesNotExist if a group was deleted out-of-band between logins. Use .filter(...).first() and skip when absent, so login is robust to that data state.

When removing a group a user has left, look it up with .filter(...).first() so a group
deleted out-of-band between logins no longer raises during login.
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.

1 participant