ui fixes, input fixes, better dev workflow
This commit is contained in:
@@ -128,6 +128,7 @@ declare module "fastify" {
|
||||
export async function buildApp(overrides: Partial<AppConfig> = {}): Promise<FastifyInstance> {
|
||||
const config = { ...env, ...overrides } as AppConfig;
|
||||
const isProd = config.NODE_ENV === "production";
|
||||
const exposeDevVerificationCode = !isProd && config.EMAIL_VERIFY_DEV_CODE_EXPOSE;
|
||||
const cookieDomain = config.COOKIE_DOMAIN || undefined;
|
||||
|
||||
const app = Fastify({
|
||||
@@ -933,7 +934,11 @@ app.post(
|
||||
userId: user.id,
|
||||
emailFingerprint: fingerprintEmail(normalizedEmail),
|
||||
});
|
||||
return { ok: true, needsVerification: true };
|
||||
return {
|
||||
ok: true,
|
||||
needsVerification: true,
|
||||
...(exposeDevVerificationCode ? { verificationCode: code } : {}),
|
||||
};
|
||||
});
|
||||
|
||||
app.post(
|
||||
@@ -1155,7 +1160,7 @@ app.post("/auth/verify/resend", codeIssueRateLimit, async (req, reply) => {
|
||||
userId: user.id,
|
||||
emailFingerprint: fingerprintEmail(normalizedEmail),
|
||||
});
|
||||
return { ok: true };
|
||||
return { ok: true, ...(exposeDevVerificationCode ? { verificationCode: code } : {}) };
|
||||
});
|
||||
|
||||
app.post(
|
||||
|
||||
Reference in New Issue
Block a user