Skip to content

Commit 5811ab8

Browse files
committed
Use BoolEnv instead of 0/1
1 parent 5bd084d commit 5811ab8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

apps/webapp/app/env.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const EnvironmentSchema = z
5959
ADMIN_EMAILS: z.string().refine(isValidRegex, "ADMIN_EMAILS must be a valid regex.").optional(),
6060
REMIX_APP_PORT: z.string().optional(),
6161
LOGIN_ORIGIN: z.string().default("http://localhost:3030"),
62-
LOGIN_RATE_LIMITS_ENABLED: z.enum(["0", "1"]).default("1"),
62+
LOGIN_RATE_LIMITS_ENABLED: BoolEnv.default(true),
6363
APP_ORIGIN: z.string().default("http://localhost:3030"),
6464
API_ORIGIN: z.string().optional(),
6565
STREAM_ORIGIN: z.string().optional(),

apps/webapp/app/routes/login.magic/route.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export async function action({ request }: ActionFunctionArgs) {
9797

9898
switch (data.action) {
9999
case "send": {
100-
if (env.LOGIN_RATE_LIMITS_ENABLED !== "1") {
100+
if (!env.LOGIN_RATE_LIMITS_ENABLED) {
101101
return authenticator.authenticate("email-link", request, {
102102
successRedirect: "/login/magic",
103103
failureRedirect: "/login/magic",

0 commit comments

Comments
 (0)