The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
move throwIfAuthenticated to lib/actions/auth
Steven Tey29b9c788b161
diff --git a/apps/web/lib/actions/middlewares/throw-if-authenticated.ts b/apps/web/lib/actions/auth/throw-if-authenticated.tssimilarity index 100%rename from apps/web/lib/actions/middlewares/throw-if-authenticated.tsrename to apps/web/lib/actions/auth/throw-if-authenticated.tsdiff --git a/apps/web/lib/actions/create-user-account.ts b/apps/web/lib/actions/create-user-account.tsindex 4135b3dd26..3ed0041ec6 100644--- a/apps/web/lib/actions/create-user-account.ts+++ b/apps/web/lib/actions/create-user-account.ts@@ -7,7 +7,7 @@ import { getIP } from "../api/utils";import { hashPassword } from "../auth/password";import z from "../zod";import { signUpSchema } from "../zod/schemas/auth";-import { throwIfAuthenticated } from "./middlewares/throw-if-authenticated";+import { throwIfAuthenticated } from "./auth/throw-if-authenticated";import { actionClient } from "./safe-action";const schema = signUpSchema.extend({diff --git a/apps/web/lib/actions/request-password-reset.ts b/apps/web/lib/actions/request-password-reset.tsindex 0ec9e66a66..4ebe12f5ba 100644--- a/apps/web/lib/actions/request-password-reset.ts+++ b/apps/web/lib/actions/request-password-reset.ts@@ -8,7 +8,7 @@ import ResetPasswordLink from "emails/reset-password-link";import { flattenValidationErrors } from "next-safe-action";import { PASSWORD_RESET_TOKEN_EXPIRY } from "../auth/constants";import { requestPasswordResetSchema } from "../zod/schemas/auth";-import { throwIfAuthenticated } from "./middlewares/throw-if-authenticated";+import { throwIfAuthenticated } from "./auth/throw-if-authenticated";import { actionClient } from "./safe-action";// Request a password reset emaildiff --git a/apps/web/lib/actions/send-otp.ts b/apps/web/lib/actions/send-otp.tsindex b5e5fa207a..c861ef0143 100644--- a/apps/web/lib/actions/send-otp.ts+++ b/apps/web/lib/actions/send-otp.ts@@ -10,7 +10,7 @@ import { generateOTP } from "../auth";import { EMAIL_OTP_EXPIRY_IN } from "../auth/constants";import z from "../zod";import { emailSchema } from "../zod/schemas/auth";-import { throwIfAuthenticated } from "./middlewares/throw-if-authenticated";+import { throwIfAuthenticated } from "./auth/throw-if-authenticated";import { actionClient } from "./safe-action";const schema = z.object({