Skip to content

Commit

Permalink
docs: fix some links in doc (#1396)
Browse files Browse the repository at this point in the history
  • Loading branch information
t6adev committed Feb 1, 2024
1 parent 64cabdf commit 966b776
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/pages/getting-started/astro.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ declare module "lucia" {

We recommend setting up a middleware to validate requests. The validated user will be available as `local.user`. You can just copy-paste the code into `src/middleware.ts`.

It's a bit verbose, but it just reads the session cookie, validates it, and sets a new cookie if necessary. Since Astro doesn't implement CSRF protection out of the box, it must be implemented. If you're curious about what's happening here, see the [Validating requests](/basics/validate-session-cookies/astro) page.
It's a bit verbose, but it just reads the session cookie, validates it, and sets a new cookie if necessary. Since Astro doesn't implement CSRF protection out of the box, it must be implemented. If you're curious about what's happening here, see the [Validating requests](/guides/validate-session-cookies/astro) page.

```ts
// src/middleware.ts
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/getting-started/nuxt.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ node --experimental-web-crypto index.js

We recommend setting up a middleware to validate requests. The validated user will be available as `event.context.user`. You can just copy-paste the code into `server/middleware/auth.ts`.

It's a bit verbose, but it just reads the session cookie, validates it, and sets a new cookie if necessary. Since Nuxt doesn't implement CSRF protection out of the box, it must be implemented. If you're curious about what's happening here, see the [Validating requests](/basics/validate-session-cookies/nuxt) page.
It's a bit verbose, but it just reads the session cookie, validates it, and sets a new cookie if necessary. Since Nuxt doesn't implement CSRF protection out of the box, it must be implemented. If you're curious about what's happening here, see the [Validating requests](/guides/validate-session-cookies/nuxt) page.

```ts
// server/middleware/auth.ts
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/getting-started/solidstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ declare module "lucia" {

We recommend setting up a middleware to validate requests. The validated user will be available as `context.user`. You can just copy-paste the code into `src/middleware.ts`.

It's a bit verbose, but it just reads the session cookie, validates it, and sets a new cookie if necessary. Since SolidStart doesn't implement CSRF protection out of the box, it must be implemented when working with cookies. If you're curious about what's happening here, see the [Validating requests](/basics/validate-session-cookies/solidstart) page.
It's a bit verbose, but it just reads the session cookie, validates it, and sets a new cookie if necessary. Since SolidStart doesn't implement CSRF protection out of the box, it must be implemented when working with cookies. If you're curious about what's happening here, see the [Validating requests](/guides/validate-session-cookies/solidstart) page.

```ts
// src/middleware.ts
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/getting-started/sveltekit.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ declare module "lucia" {

We recommend setting up a handle hook to validate requests. The validated user will be available as `local.user`.

If you're curious about what's happening here, see the [Validating requests](/basics/validate-session-cookies/sveltekit) page.
If you're curious about what's happening here, see the [Validating requests](/guides/validate-session-cookies/sveltekit) page.

```ts
// src/hooks.server.ts
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/tutorials/github-oauth/nextjs-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ interface GitHubUser {

## Validate requests

Create `validateRequest()`. This will check for the session cookie, validate it, and set a new cookie if necessary. Make sure to catch errors when setting cookies and wrap the function with `cache()` to prevent unnecessary database calls. To learn more, see the [Validating requests](/basics/validate-session-cookies/nextjs-app) page.
Create `validateRequest()`. This will check for the session cookie, validate it, and set a new cookie if necessary. Make sure to catch errors when setting cookies and wrap the function with `cache()` to prevent unnecessary database calls. To learn more, see the [Validating requests](/guides/validate-session-cookies/nextjs-app) page.

CSRF protection should be implemented but Next.js handles it when using form actions (but not for API routes).

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/tutorials/github-oauth/nextjs-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ interface GitHubUser {

## Validate requests

Create `validateRequest()`. This will check for the session cookie, validate it, and set a new cookie if necessary. To learn more, see the [Validating requests](/basics/validate-session-cookies/nextjs-pages) page.
Create `validateRequest()`. This will check for the session cookie, validate it, and set a new cookie if necessary. To learn more, see the [Validating requests](/guides/validate-session-cookies/nextjs-pages) page.

CSRF protection should be implemented and you should already have a middleware for it.

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/tutorials/username-and-password/nextjs-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ async function login(_: any, formData: FormData): Promise<ActionResult> {

## Validate requests

Create `validateRequest()`. This will check for the session cookie, validate it, and set a new cookie if necessary. Make sure to catch errors when setting cookies and wrap the function with `cache()` to prevent unnecessary database calls. To learn more, see the [Validating requests](/basics/validate-session-cookies/nextjs-app) page.
Create `validateRequest()`. This will check for the session cookie, validate it, and set a new cookie if necessary. Make sure to catch errors when setting cookies and wrap the function with `cache()` to prevent unnecessary database calls. To learn more, see the [Validating requests](/guides/validate-session-cookies/nextjs-app) page.

CSRF protection should be implemented but Next.js handles it when using form actions (but not for API routes).

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/tutorials/username-and-password/nextjs-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)

## Validate requests

Create `validateRequest()`. This will check for the session cookie, validate it, and set a new cookie if necessary. To learn more, see the [Validating requests](/basics/validate-session-cookies/nextjs-pages) page.
Create `validateRequest()`. This will check for the session cookie, validate it, and set a new cookie if necessary. To learn more, see the [Validating requests](/guides/validate-session-cookies/nextjs-pages) page.

CSRF protection should be implemented and you should already have a middleware for it.

Expand Down
2 changes: 0 additions & 2 deletions docs/pages/upgrade-v3/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,5 +209,3 @@ const nextConfig = {
}
};
```


2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"publish-setup": "pnpm i --no-frozen-lockfile && cd packages/lucia && pnpm build && cd ../adapter-test && pnpm build && cd ../../",
"format": "pnpm exec prettier --write . --plugin=prettier-plugin-astro",
"format:docs": "pnpm exec prettier --write documentation --plugin=prettier-plugin-astro",
"format:docs": "pnpm exec prettier --write docs --plugin=prettier-plugin-astro",
"preinstall": "npx only-allow pnpm",
"auri.format": "pnpm format",
"auri.publish_setup": "pnpm publish-setup"
Expand Down

0 comments on commit 966b776

Please sign in to comment.