Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" });
};
```
Expand All @@ -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",
});
Expand Down Expand Up @@ -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",
});
Expand Down Expand Up @@ -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",
Expand Down