Skip to content

Commit

Permalink
Update README.md and Fix Errors handling section example (#256)
Browse files Browse the repository at this point in the history
* Update README.md and Fix Errors handling section example

In Errors Handling section example when we read Errors from flash we must also commit the new session otherwise the error still remain in the session

* Update README.md

---------

Co-authored-by: Sergio Xalambrí <[email protected]>
  • Loading branch information
aliabdy and sergiodxa authored Nov 9, 2023
1 parent 05ef79f commit 93875c1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,11 @@ export async function loader({ request }: LoaderArgs) {
});
let session = await getSession(request.headers.get("cookie"));
let error = session.get(authenticator.sessionErrorKey);
return json({ error });
return json({ error }, {
headers:{
'Set-Cookie': await commitSession(session) // You must commit the session whenever you read a flash
}
});
};
```

Expand Down

0 comments on commit 93875c1

Please sign in to comment.