- Add password-reset Prisma schema for OTP tracking - Add API contract schemas (start, verify, resend) - Add password-reset service with OTP validation and email sending - Add frontend reset-password page with 2-step flow - Add InputOTP component usage for OTP input - Add link to reset-password in login page - Remove link to About in login - Center and resize login/reset password forms
32 lines
991 B
TypeScript
32 lines
991 B
TypeScript
import { resendPasswordResetHandler } from '@/modules/password-reset/handlers/resend-password-reset.handler';
|
|
import { startPasswordResetHandler } from '@/modules/password-reset/handlers/start-password-reset.handler';
|
|
import { verifyPasswordResetHandler } from '@/modules/password-reset/handlers/verify-password-reset.handler';
|
|
import type { AppEnv } from '@/types/hono';
|
|
import { zValidator } from '@hono/zod-validator';
|
|
import {
|
|
passwordResetResendSchema,
|
|
passwordResetStartSchema,
|
|
passwordResetVerifySchema,
|
|
} from '@repo/api-contract';
|
|
import { Hono } from 'hono';
|
|
|
|
export const passwordResetRoutes = new Hono<AppEnv>();
|
|
|
|
passwordResetRoutes.post(
|
|
'/start',
|
|
zValidator('json', passwordResetStartSchema),
|
|
startPasswordResetHandler
|
|
);
|
|
|
|
passwordResetRoutes.post(
|
|
'/verify',
|
|
zValidator('json', passwordResetVerifySchema),
|
|
verifyPasswordResetHandler
|
|
);
|
|
|
|
passwordResetRoutes.post(
|
|
'/resend',
|
|
zValidator('json', passwordResetResendSchema),
|
|
resendPasswordResetHandler
|
|
);
|