Skip to content

Commit 1d9ae20

Browse files
authored
Update Types in readme code snippets (#260)
Update README.md update readme file code snippets to use consistent types.
1 parent 7f0f4bc commit 1d9ae20

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ if (user) {
169169
Once the user is ready to leave the application, we can call the `logout` method inside an action.
170170

171171
```ts
172-
export async function action({ request }: ActionArgs) {
172+
export async function action({ request }: ActionFunctionArgs) {
173173
await authenticator.logout(request, { redirectTo: "/login" });
174174
};
175175
```
@@ -185,7 +185,7 @@ If we do not pass the `successRedirect` option to the `authenticator.authenticat
185185
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.
186186

187187
```ts
188-
export async function action({ request }: ActionArgs) {
188+
export async function action({ request }: ActionFunctionArgs) {
189189
let user = await authenticator.authenticate("user-pass", request, {
190190
failureRedirect: "/login",
191191
});
@@ -234,7 +234,7 @@ Furthermore, we can read the error using that key after a failed authentication.
234234

235235
```ts
236236
// in the loader of the login route
237-
export async function loader({ request }: LoaderArgs) {
237+
export async function loader({ request }: LoaderFunctionArgs) {
238238
await authenticator.isAuthenticated(request, {
239239
successRedirect: "/dashboard",
240240
});
@@ -271,7 +271,7 @@ Alternatively, we can do it on the action itself.
271271
```ts
272272
import { AuthorizationError } from "remix-auth";
273273

274-
export async function action({ request }: ActionArgs) {
274+
export async function action({ request }: ActionFunctionArgs) {
275275
try {
276276
return await authenticator.authenticate("user-pass", request, {
277277
successRedirect: "/dashboard",

0 commit comments

Comments
 (0)