Skip to content

Commit

Permalink
Fix type annotation for action function parameters in README
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiodxa committed Dec 17, 2024
1 parent 2e51e6f commit 7b58c4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export async function action({ request }: Route.ActionArgs) {
In case of error, the authenticator and the strategy will simply throw an error. You can catch it and handle it as you wish.

```ts
export async function action({ request }: ActionFunctionArgs) {
export async function action({ request }: Route.ActionArgs) {
try {
return await authenticator.authenticate("user-pass", request);
} catch (error) {
Expand All @@ -169,7 +169,7 @@ export async function action({ request }: ActionFunctionArgs) {
Because you're in charge of keeping the user data after login, how you handle the logout will depend on that. You can simply remove the user data from the session, or you can create a new session, or you can even invalidate the session.

```ts
export async function action({ request }: ActionFunctionArgs) {
export async function action({ request }: Route.ActionArgs) {
let session = await sessionStorage.getSession(request.headers.get("cookie"));
return redirect("/login", {
headers: { "Set-Cookie": await sessionStorage.destroySession(session) },
Expand Down

0 comments on commit 7b58c4c

Please sign in to comment.