Skip to content

Commit 47698ff

Browse files
committed
update remix-utils to v8
1 parent 2e48f5e commit 47698ff

File tree

9 files changed

+59
-40
lines changed

9 files changed

+59
-40
lines changed

app/root.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export async function loader({ request }: Route.LoaderArgs) {
105105
await logout({ request, redirectTo: '/' })
106106
}
107107
const { toast, headers: toastHeaders } = await getToast(request)
108-
const honeyProps = honeypot.getInputProps()
108+
const honeyProps = await honeypot.getInputProps()
109109

110110
return data(
111111
{

app/routes/_auth+/forgot-password.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const ForgotPasswordSchema = z.object({
2525

2626
export async function action({ request }: Route.ActionArgs) {
2727
const formData = await request.formData()
28-
checkHoneypot(formData)
28+
await checkHoneypot(formData)
2929
const submission = await parseWithZod(formData, {
3030
schema: ForgotPasswordSchema.superRefine(async (data, ctx) => {
3131
const user = await prisma.user.findFirst({

app/routes/_auth+/login.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export async function loader({ request }: Route.LoaderArgs) {
3838
export async function action({ request }: Route.ActionArgs) {
3939
await requireAnonymous(request)
4040
const formData = await request.formData()
41-
checkHoneypot(formData)
41+
await checkHoneypot(formData)
4242
const submission = await parseWithZod(formData, {
4343
schema: (intent) =>
4444
LoginFormSchema.transform(async (data, ctx) => {

app/routes/_auth+/onboarding.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export async function loader({ request }: Route.LoaderArgs) {
5656
export async function action({ request }: Route.ActionArgs) {
5757
const email = await requireOnboardingEmail(request)
5858
const formData = await request.formData()
59-
checkHoneypot(formData)
59+
await checkHoneypot(formData)
6060
const submission = await parseWithZod(formData, {
6161
schema: (intent) =>
6262
SignupFormSchema.superRefine(async (data, ctx) => {

app/routes/_auth+/signup.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const SignupSchema = z.object({
3131
export async function action({ request }: Route.ActionArgs) {
3232
const formData = await request.formData()
3333

34-
checkHoneypot(formData)
34+
await checkHoneypot(formData)
3535

3636
const submission = await parseWithZod(formData, {
3737
schema: SignupSchema.superRefine(async (data, ctx) => {

app/routes/_auth+/verify.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const VerifySchema = z.object({
3434

3535
export async function action({ request }: Route.ActionArgs) {
3636
const formData = await request.formData()
37-
checkHoneypot(formData)
37+
await checkHoneypot(formData)
3838
return validateRequest(request, formData)
3939
}
4040

app/utils/honeypot.server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ export const honeypot = new Honeypot({
55
encryptionSeed: process.env.HONEYPOT_SECRET,
66
})
77

8-
export function checkHoneypot(formData: FormData) {
8+
export async function checkHoneypot(formData: FormData) {
99
try {
10-
honeypot.check(formData)
10+
await honeypot.check(formData)
1111
} catch (error) {
1212
if (error instanceof SpamError) {
1313
throw new Response('Form not submitted properly', { status: 400 })

package-lock.json

Lines changed: 48 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353
"@epic-web/totp": "^2.0.0",
5454
"@mjackson/form-data-parser": "^0.6.0",
5555
"@nasa-gcn/remix-seo": "^2.0.1",
56+
"@oslojs/crypto": "^1.0.1",
57+
"@oslojs/encoding": "^1.1.0",
5658
"@paralleldrive/cuid2": "^2.2.2",
5759
"@prisma/client": "^6.2.1",
5860
"@radix-ui/react-checkbox": "^1.1.3",
@@ -80,7 +82,6 @@
8082
"compression": "^1.7.5",
8183
"cookie": "^1.0.2",
8284
"cross-env": "^7.0.3",
83-
"crypto-js": "^4.2.0",
8485
"date-fns": "^4.1.0",
8586
"dotenv": "^16.4.7",
8687
"execa": "^9.5.2",
@@ -102,7 +103,7 @@
102103
"react-router": "^7.1.3",
103104
"remix-auth": "^3.7.0",
104105
"remix-auth-github": "^1.7.0",
105-
"remix-utils": "^7.7.0",
106+
"remix-utils": "^8.0.0",
106107
"set-cookie-parser": "^2.7.1",
107108
"sonner": "^1.7.2",
108109
"source-map-support": "^0.5.21",

0 commit comments

Comments
 (0)