From 1d6679b633926f596d1edd0f3e60644a7a6c9541 Mon Sep 17 00:00:00 2001 From: Shyam Lohar Date: Sat, 2 Dec 2023 16:35:35 +0530 Subject: [PATCH] Update README.md update readme file code snippets to use consistent types. --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3556ad3..6557120 100644 --- a/README.md +++ b/README.md @@ -169,7 +169,7 @@ if (user) { Once the user is ready to leave the application, we can call the `logout` method inside an action. ```ts -export async function action({ request }: ActionArgs) { +export async function action({ request }: ActionFunctionArgs) { await authenticator.logout(request, { redirectTo: "/login" }); }; ``` @@ -185,7 +185,7 @@ If we do not pass the `successRedirect` option to the `authenticator.authenticat Note that we will need to store the user data in the session this way. To ensure we use the correct session key, the authenticator has a `sessionKey` property. ```ts -export async function action({ request }: ActionArgs) { +export async function action({ request }: ActionFunctionArgs) { let user = await authenticator.authenticate("user-pass", request, { failureRedirect: "/login", }); @@ -234,7 +234,7 @@ Furthermore, we can read the error using that key after a failed authentication. ```ts // in the loader of the login route -export async function loader({ request }: LoaderArgs) { +export async function loader({ request }: LoaderFunctionArgs) { await authenticator.isAuthenticated(request, { successRedirect: "/dashboard", }); @@ -271,7 +271,7 @@ Alternatively, we can do it on the action itself. ```ts import { AuthorizationError } from "remix-auth"; -export async function action({ request }: ActionArgs) { +export async function action({ request }: ActionFunctionArgs) { try { return await authenticator.authenticate("user-pass", request, { successRedirect: "/dashboard",