Skip to content

Add email verification for admin login (email code + password) #82

Closed

Description

@vybe

Summary

Admin users should authenticate using both a password and an email verification code, combining the two existing auth methods into a single two-step flow.

Current Behavior

  • Regular users: Login with email → receive 6-digit code → enter code
  • Admin users: Login with username + password only (no email verification)

Desired Behavior

Admin login should require two factors:

  1. Admin enters email/username and password
  2. If password is correct, a 6-digit verification code is sent to the admin's email
  3. Admin enters the code to complete login

This adds an extra layer of security for admin accounts by combining password authentication with email-based verification.

Acceptance Criteria

  • Admin login flow requires both password and email verification code
  • Password is validated first before sending email code
  • Email code is sent to the admin's registered email address
  • JWT is only issued after both password and code are verified
  • Frontend admin login UI updated to support the two-step flow
  • Existing regular user email-only login remains unchanged
  • Error messages don't leak whether password or code was incorrect

Technical Notes

  • Backend: Modify admin auth endpoint in src/backend/main.py or auth router
  • Frontend: Update admin login component to add code entry step
  • Reuse existing email sending infrastructure from regular user login flow

Labels

Security, Enhancement

Activity

  1. added
    complexity-medium
    theme-security
    on Jun 3, 2026
  2. added
    type-feature
    on Jun 3, 2026
  3. added
    status-incubating
    status-ready
    and removed
    status-incubating
    status-ready
    on Jun 14, 2026
  4. vybe commented on Jun 22, 2026

    @vybe
    ContributorAuthor

    /claim

  5. added
    status-in-progress
    on Jun 22, 2026
  6. github-actions commented on Jun 22, 2026

    @github-actions

    Claimed by @vybe. Label status-in-progress added.

    Next steps:

    1. Create branch: feature/82-<short-slug>
    2. Implement the feature
    3. Open a PR with Fixes #82
  7. added a commit that references this issue on Jun 23, 2026
  8. added
    status-in-dev
    and removed
    status-in-progress
    on Jun 23, 2026
  9. added a commit that references this issue on Jul 8, 2026
  10. removed
    status-in-dev
    on Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

complexity-mediumpriority-p3theme-securitytype-feature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions