diff --git a/README.md b/README.md index 66b4ef7..b86b8be 100644 --- a/README.md +++ b/README.md @@ -64,10 +64,10 @@ authenticator.use( ); ``` -In order to authenticate a user, you can use the following inside of an ActionFunction: +In order to authenticate a user, you can use the following inside of an `action` function: ```ts -export const action: ActionFunction = async ({ request, context }) => { +export async function action({ context, request }: ActionArgs) { return await authenticator.authenticate("form", request, { successRedirect: "/", failureRedirect: "/login", @@ -81,7 +81,7 @@ export const action: ActionFunction = async ({ request, context }) => { Because you may want to do validations or read valeus from the FormData before calling `authenticate`, the FormStrategy allows you to pass a FormData object as part of the optional context. ```ts -export const action: ActionFunction = async ({ request, context }) => { +export async function action({ context, request }: ActionArgs) { let formData = await request.formData(); return await authenticator.authenticate("form", request, { // use formData here