Skip to content

Commit

Permalink
second draft is ready
Browse files Browse the repository at this point in the history
  • Loading branch information
Claradev32 committed Jul 9, 2024
1 parent 0ea83c0 commit 160b39a
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions directus-job-board-platform/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ export const useAuth = () => useContext(AuthContext)!;
Update the `AuthContext.tsx` file to implement user login. First, add the following functions to save, retrieve, and delete user sessions:

```ts
+
//...
const setCookie = (name: string, value: string, days: number = 7) => {
const expires = new Date(Date.now() + days * 864e5).toUTCString();
Expand All @@ -173,7 +172,6 @@ const deleteCookie = (name: string) => {
Then implement the login functionality with the following code:

```ts
+
//...
import { createUser, readMe, withToken } from "@directus/sdk";

Expand Down Expand Up @@ -210,7 +208,6 @@ export function AuthProvider(props: { children: JSX.Element }) {
Update the `AuthContext.tsx` file to add user logout functionality:

```ts
+
//...

export function AuthProvider(props: { children: JSX.Element }) {
Expand Down Expand Up @@ -246,7 +243,6 @@ export function AuthProvider(props: { children: JSX.Element }) {
### Getting Active User Data
Add the following code to the `AuthContext` to fetch the details of the actively logged-in user:
```ts
+
//...
export function AuthProvider(props: { children: JSX.Element }) {
// ...
Expand Down

0 comments on commit 160b39a

Please sign in to comment.