Skip to content

feat(auth): forgot password flow and login by email or username#8

Merged
BODMAT merged 2 commits into
masterfrom
feat/forgot-password
May 21, 2026
Merged

feat(auth): forgot password flow and login by email or username#8
BODMAT merged 2 commits into
masterfrom
feat/forgot-password

Conversation

@BODMAT
Copy link
Copy Markdown
Owner

@BODMAT BODMAT commented May 21, 2026

Password reset via email link and sign-in by email or username.

Backend

  • New POST /forgot-password - creates a reset token (1h TTL), sends link to user email. Always returns 200 to prevent email enumeration. Skips Google-only accounts.
  • New POST /reset-password - validates token, hashes and saves new password, upserts local identity.
  • Login handler now accepts email or username - searches by email if input contains @, else by login.
  • @ forbidden in usernames (RegisterSchema, UpdateProfileSchema) to keep the distinction unambiguous.
  • New passwordResetHandlers.ts, sendPasswordResetEmail in emailService, ForgotPasswordSchema and ResetPasswordSchema added to AuthSchema.

Frontend

  • ForgotPasswordStage.tsx - email input form with "Check your inbox" success state, added as forgot stage in AuthPopup.
  • ResetPasswordPopup.tsx - two-field password form opened automatically when user follows ?auth=reset_password&token=... link.
  • "Forgot password?" link below password field in sign-in mode.
  • "Forgot password?" button in AccountSettings - Password section - sends reset link directly to user's email.
  • forgotPassword and resetPassword mutations added to auth.api.

BODMAT added 2 commits May 21, 2026 22:26
backend handlers, email token, frontend form and URL param handling
backend looks up user by email if input contains @, else by login.
@ is forbidden in login name at register and profile update to keep the distinction unambiguous.
@BODMAT BODMAT merged commit ae37d33 into master May 21, 2026
1 check passed
@BODMAT BODMAT deleted the feat/forgot-password branch May 21, 2026 19:37
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