File tree Expand file tree Collapse file tree 9 files changed +59
-40
lines changed Expand file tree Collapse file tree 9 files changed +59
-40
lines changed Original file line number Diff line number Diff 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 {
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ const ForgotPasswordSchema = z.object({
2525
2626export 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 ( {
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ export async function loader({ request }: Route.LoaderArgs) {
3838export 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 ) => {
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ export async function loader({ request }: Route.LoaderArgs) {
5656export 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 ) => {
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ const SignupSchema = z.object({
3131export 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 ) => {
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ export const VerifySchema = z.object({
3434
3535export 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
Original file line number Diff line number Diff 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 } )
Original file line number Diff line number Diff line change 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" ,
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" ,
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" ,
You can’t perform that action at this time.
0 commit comments