Skip to content

Refuse every OIDC login of a disabled user, not only the first - #1483

Merged
tomchop merged 1 commit into
yeti-platform:mainfrom
kev365:fix/oidc-disabled-user-session
Nov 19, 2026
Merged

tomchop merged 1 commit into
yeti-platform:mainfrom
kev365:fix/oidc-disabled-user-session

Conversation

@kev365

@kev365 kev365 commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Fixes #1479.

oidc_callback answered 401 "User account disabled" only in the branch that creates the user on a first login. A later login of the same, still disabled user fell through and got a yeti_session cookie. So did a user an admin had disabled.

The callback now checks enabled before issuing the session and answers the same 401. Password login, the API key exchange and the ID-token exchange already refuse a disabled user.

Tests: test_disabled_user_gets_no_session in OIDCLoginTest logs the same unknown address in twice. Both answers are 401 with the message and no cookie, and the user stays disabled. On the unchanged code the second login answers 307.

Checks: ruff, ty and the three test directories in a CI-equivalent environment.

🤖 Generated with Claude Code

oidc_callback answered 401 "User account disabled" only in the branch
that creates the user on a first login. A later login of the same, still
disabled user, or of a user an admin had disabled, fell through and got a
yeti_session cookie. The cookie reached /auth/me only, since the routers
require an enabled user.

The callback now checks enabled before issuing the session and answers
the same 401.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@tomchop
tomchop merged commit a388e60 into yeti-platform:main Nov 19, 2026
5 checks passed
@kev365
kev365 deleted the fix/oidc-disabled-user-session branch November 20, 2026 00:29
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.

A disabled user gets a session cookie from the second OIDC login on

2 participants