Skip to content

merge dev into stage#83

Merged
aditya-arcot merged 9 commits intostagefrom
dev
Mar 6, 2026
Merged

merge dev into stage#83
aditya-arcot merged 9 commits intostagefrom
dev

Conversation

@aditya-arcot
Copy link
Member

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the login flow to support authentication with either a username or an email address, replacing the previous username-only login. A new get_user_by_identifier service function performs an OR-based lookup, the LoginRequest schema is updated to accept either field, and the client UI and generated API types are updated accordingly.

Changes:

  • New LoginRequest schema accepts either username or email (with a model-validator enforcing at least one) and exposes a computed identifier property
  • New get_user_by_identifier DB query replaces get_user_by_username in the authentication path; authenticate_user and login service signatures renamed usernameidentifier
  • Client Login.tsx unified the form input into a single "Username or Email" field; generated TypeScript types and Zod schemas updated to match

Reviewed changes

Copilot reviewed 13 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
server/app/models/schemas/types.py Introduces shared Pydantic type aliases (Name, Username, Password, Token, Email)
server/app/models/schemas/auth.py Updates LoginRequest to accept username | None and email | None with cross-field validator and identifier property
server/app/services/user.py Adds get_user_by_identifier using or_() on username and email columns
server/app/core/security.py authenticate_user now takes identifier and delegates to get_user_by_identifier
server/app/services/auth.py login signature uses identifier instead of username
server/app/api/endpoints/auth.py Passes req.identifier to the login service
client/src/pages/Login.tsx Replaces username-only input with combined identifier input; builds correct API payload in onSubmit
client/src/api/generated/types.gen.ts LoginRequest type now has optional username and new optional email
client/src/api/generated/zod.gen.ts zLoginRequest schema updated to make username nullish, add email nullish field
client/src/api/generated/schemas.gen.ts OpenAPI schema updated: username optional, email added, only password required
server/app/tests/services/user/test_get_user_by_identifier.py New tests for get_user_by_identifier
server/app/tests/services/auth/test_login.py Adds email login test, renames username to identifier
server/app/tests/models/schemas/test_auth.py New unit tests for LoginRequest validator
server/app/tests/core/security/test_authenticate_user.py Adds email authentication test, renames param
server/app/tests/api/utilities.py login helper extended to optionally accept email
server/app/tests/api/auth/test_login.py New email login and missing-identifier tests replace old invalid-body test

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 19 out of 22 changed files in this pull request and generated no new comments.

@aditya-arcot aditya-arcot merged commit 1c9c83c into stage Mar 6, 2026
7 checks passed
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.

2 participants