TypeScript Error: ActionArgs not assignable to Request in better-auth handler

Following the docs at https://www.better-auth.com/docs/integrations/remix for setting up the API route handler, but getting a TypeScript error when passing the request object.
import { authClient } from "~/lib/auth-client";
import { type Route } from "../+types/root";
import { auth } from "~/lib/auth";
import { Form } from "react-router";

export async function action({ request }: { request: Route.ActionArgs }) {
return auth.handler(request);
}

export default function Signin() {
return (
<div className="pt-12 flex items-center justify-center">
<div className="p-12 border rounded-md space-y-4">
<p className="text-center">welcome back</p>
<Form action="" method="post">
<button className="border rounded-md px-2 py-1">
continue with google
</button>
</Form>
</div>
</div>
);
}
import { authClient } from "~/lib/auth-client";
import { type Route } from "../+types/root";
import { auth } from "~/lib/auth";
import { Form } from "react-router";

export async function action({ request }: { request: Route.ActionArgs }) {
return auth.handler(request);
}

export default function Signin() {
return (
<div className="pt-12 flex items-center justify-center">
<div className="p-12 border rounded-md space-y-4">
<p className="text-center">welcome back</p>
<Form action="" method="post">
<button className="border rounded-md px-2 py-1">
continue with google
</button>
</Form>
</div>
</div>
);
}
Error:
Argument of type 'ActionArgs' is not assignable to parameter of type 'Request'.
Type 'ActionArgs' is missing the following properties from type 'Request':
cache, credentials, destination, headers, and 18 more
Argument of type 'ActionArgs' is not assignable to parameter of type 'Request'.
Type 'ActionArgs' is missing the following properties from type 'Request':
cache, credentials, destination, headers, and 18 more
Remix Integration | Better Auth
Integrate Better Auth with Remix.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?