Repository navigation
refactor(controllers/web): dep-inject login and forgot-password payloads (#36659) - #40856
Merged
asukaminato0721 merged 1 commit intoAug 17, 2026
Merged
Conversation
…ads (langgenius#36659) Use @model_validate on the remaining web auth handlers so request payloads are injected instead of parsed inline from web_ns.payload / request.args. Matches the existing console/web controller pattern.
asukaminato0721
enabled auto-merge
August 17, 2026 05:43
asukaminato0721
approved these changes
Aug 17, 2026
Contributor
Pyrefly Type Coverage
|
3 of 5 tasks
This was referenced Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
Summary
#36659
Extends the
@model_validatedependency-injection decorator to the remaining web auth handlers that still parsed their Pydantic schema inline fromweb_ns.payload/request.args:ForgotPasswordSendEmailApi.post,ForgotPasswordCheckApi.post,ForgotPasswordResetApi.post(controllers/web/forgot_password.py)LoginApi.post,LoginStatusApi.get,EmailCodeLoginSendEmailApi.post,EmailCodeLoginApi.post(controllers/web/login.py)Each handler now receives its validated query/payload model as a parameter via
@model_validate(Schema).LoginApi.postandEmailCodeLoginApi.postkeep@decrypt_password_field/@decrypt_code_fieldoutside@model_validate, so decryption still runs before validation.No behavior change: request parsing, validation errors, and response shapes are identical.
Testing
uv run --project api pytest api/tests/unit_tests/controllers/web/test_web_forgot_password.py api/tests/unit_tests/controllers/web/test_web_login.py -o addopts=→ 17 passeduv run --project api ruff check/ruff format --checkon the two changed files → cleanExisting unit tests still drive the decorated handlers through Flask
test_request_context, so they cover the decorator path rather than callinginspect.unwrap.Screenshots
Checklist
From OpenCode