Skip to content

Commit

Permalink
docs: Add /tutorials page, fix typo in docs, fix examples repo links (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoGauthier authored Jan 27, 2024
1 parent 83b76e7 commit b78a2bb
Show file tree
Hide file tree
Showing 20 changed files with 58 additions and 33 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 @@ -99,6 +99,6 @@ declare namespace App {

## Next steps

You can learn all the concepts and APIs by reading the [Basics section](/basics/sessions) in the docs. If you prefer writing code immediately, check out the [Tutorials](/tutorials) page or the [examples repository](https://github.com/lucia-auth/examples/tree/v3).
You can learn all the concepts and APIs by reading the [Basics section](/basics/sessions) in the docs. If you prefer writing code immediately, check out the [Tutorials](/tutorials) page or the [examples repository](https://github.com/lucia-auth/examples/tree/main).

If you have any questions, [join our Discord server](https://discord.com/invite/PwrK3kpVR3)!
4 changes: 2 additions & 2 deletions docs/pages/getting-started/express.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ declare module "lucia" {

## Polyfill

If you're using Node.js 18 or below, you'll need to polyfill the Web Crypto API. This is not required in Node.js 20, CouldFlare Workers, Deno, Bun, and Vercel Edge Functions. This can be done either by importing `webcrypto`, or by enabling an experimental flag.
If you're using Node.js 18 or below, you'll need to polyfill the Web Crypto API. This is not required in Node.js 20, CloudFlare Workers, Deno, Bun, and Vercel Edge Functions. This can be done either by importing `webcrypto`, or by enabling an experimental flag.

```ts
import { webcrypto } from "node:crypto";
Expand All @@ -54,6 +54,6 @@ node --experimental-web-crypto index.js

## Next steps

You can learn all the concepts and APIs by reading the [Basics section](/basics/sessions) in the docs. If you prefer writing code immediately, check out the [Tutorials](/tutorials) page or the [examples repository](https://github.com/lucia-auth/examples/tree/v3).
You can learn all the concepts and APIs by reading the [Basics section](/basics/sessions) in the docs. If you prefer writing code immediately, check out the [Tutorials](/tutorials) page or the [examples repository](https://github.com/lucia-auth/examples/tree/main).

If you have any questions, [join our Discord server](https://discord.com/invite/PwrK3kpVR3)!
2 changes: 1 addition & 1 deletion docs/pages/getting-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ declare module "lucia" {

## Polyfill

If you're using Node.js 18 or below, you'll need to polyfill the Web Crypto API. This is not required in Node.js 20, CouldFlare Workers, Deno, Bun, and Vercel Edge Functions. This can be done either by importing `webcrypto`, or by enabling an experimental flag.
If you're using Node.js 18 or below, you'll need to polyfill the Web Crypto API. This is not required in Node.js 20, CloudFlare Workers, Deno, Bun, and Vercel Edge Functions. This can be done either by importing `webcrypto`, or by enabling an experimental flag.

```ts
import { webcrypto } from "node:crypto";
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/getting-started/nextjs-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ declare module "lucia" {

## Polyfill

If you're using Node.js 18 or below, you'll need to polyfill the Web Crypto API. This is not required in Node.js 20, CouldFlare Workers, Deno, Bun, and Vercel Edge Functions. This can be done either by importing `webcrypto`, or by enabling an experimental flag.
If you're using Node.js 18 or below, you'll need to polyfill the Web Crypto API. This is not required in Node.js 20, CloudFlare Workers, Deno, Bun, and Vercel Edge Functions. This can be done either by importing `webcrypto`, or by enabling an experimental flag.

```ts
import { webcrypto } from "node:crypto";
Expand Down Expand Up @@ -72,6 +72,6 @@ const nextConfig = {

## Next steps

You can learn all the concepts and APIs by reading the [Basics section](/basics/sessions) in the docs. If you prefer writing code immediately, check out the [Tutorials](/tutorials) page or the [examples repository](https://github.com/lucia-auth/examples/tree/v3).
You can learn all the concepts and APIs by reading the [Basics section](/basics/sessions) in the docs. If you prefer writing code immediately, check out the [Tutorials](/tutorials) page or the [examples repository](https://github.com/lucia-auth/examples/tree/main).

If you have any questions, [join our Discord server](https://discord.com/invite/PwrK3kpVR3)!
4 changes: 2 additions & 2 deletions docs/pages/getting-started/nextjs-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ declare module "lucia" {

## Polyfill

If you're using Node.js 18 or below, you'll need to polyfill the Web Crypto API. This is not required in Node.js 20, CouldFlare Workers, Deno, Bun, and Vercel Edge Functions. This can be done either by importing `webcrypto`, or by enabling an experimental flag.
If you're using Node.js 18 or below, you'll need to polyfill the Web Crypto API. This is not required in Node.js 20, CloudFlare Workers, Deno, Bun, and Vercel Edge Functions. This can be done either by importing `webcrypto`, or by enabling an experimental flag.

```ts
import { webcrypto } from "node:crypto";
Expand Down Expand Up @@ -80,6 +80,6 @@ export async function middleware(request: NextRequest): Promise<NextResponse> {

## Next steps

You can learn all the concepts and APIs by reading the [Basics section](/basics/sessions) in the docs. If you prefer writing code immediately, check out the [Tutorials](/tutorials) page or the [examples repository](https://github.com/lucia-auth/examples/tree/v3).
You can learn all the concepts and APIs by reading the [Basics section](/basics/sessions) in the docs. If you prefer writing code immediately, check out the [Tutorials](/tutorials) page or the [examples repository](https://github.com/lucia-auth/examples/tree/main).

If you have any questions, [join our Discord server](https://discord.com/invite/PwrK3kpVR3)!
4 changes: 2 additions & 2 deletions docs/pages/getting-started/nuxt.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ declare module "lucia" {

## Polyfill

If you're using Node.js 18 or below, you'll need to polyfill the Web Crypto API. This is not required in Node.js 20, CouldFlare Workers, Deno, Bun, and Vercel Edge Functions. This can be done either by importing `webcrypto`, or by enabling an experimental flag.
If you're using Node.js 18 or below, you'll need to polyfill the Web Crypto API. This is not required in Node.js 20, CloudFlare Workers, Deno, Bun, and Vercel Edge Functions. This can be done either by importing `webcrypto`, or by enabling an experimental flag.

```ts
import { webcrypto } from "node:crypto";
Expand Down Expand Up @@ -106,6 +106,6 @@ declare module "h3" {

## Next steps

You can learn all the concepts and APIs by reading the [Basics section](/basics/sessions) in the docs. If you prefer writing code immediately, check out the [Tutorials](/tutorials) page or the [examples repository](https://github.com/lucia-auth/examples/tree/v3).
You can learn all the concepts and APIs by reading the [Basics section](/basics/sessions) in the docs. If you prefer writing code immediately, check out the [Tutorials](/tutorials) page or the [examples repository](https://github.com/lucia-auth/examples/tree/main).

If you have any questions, [join our Discord server](https://discord.com/invite/PwrK3kpVR3)!
2 changes: 1 addition & 1 deletion docs/pages/getting-started/solidstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,6 @@ export default defineConfig({

## Next steps

You can learn all the concepts and APIs by reading the [Basics section](/basics/sessions) in the docs. If you prefer writing code immediately, check out the [Tutorials](/tutorials) page or the [examples repository](https://github.com/lucia-auth/examples/tree/v3).
You can learn all the concepts and APIs by reading the [Basics section](/basics/sessions) in the docs. If you prefer writing code immediately, check out the [Tutorials](/tutorials) page or the [examples repository](https://github.com/lucia-auth/examples/tree/main).

If you have any questions, [join our Discord server](https://discord.com/invite/PwrK3kpVR3)!
2 changes: 1 addition & 1 deletion docs/pages/getting-started/sveltekit.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,6 @@ export {};

## Next steps

You can learn all the concepts and APIs by reading the [Basics section](/basics/sessions) in the docs. If you prefer writing code immediately, check out the [Tutorials](/tutorials) page or the [examples repository](https://github.com/lucia-auth/examples/tree/v3).
You can learn all the concepts and APIs by reading the [Basics section](/basics/sessions) in the docs. If you prefer writing code immediately, check out the [Tutorials](/tutorials) page or the [examples repository](https://github.com/lucia-auth/examples/tree/main).

If you have any questions, [join our Discord server](https://discord.com/invite/PwrK3kpVR3)!
4 changes: 2 additions & 2 deletions docs/pages/tutorials/github-oauth/astro.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ title: "GitHub OAuth in Astro"

Before starting, make sure you've set up your database and middleware as described in the [Getting started](/getting-started/astro) page.

An [example project](https://github.com/lucia-auth/examples/tree/v3/astro/github-oauth) based on this tutorial is also available. You can clone the example locally or [open it in StackBlitz](https://stackblitz.com/github/lucia-auth/examples/tree/v3/astro/github-oauth).
An [example project](https://github.com/lucia-auth/examples/tree/main/astro/github-oauth) based on this tutorial is also available. You can clone the example locally or [open it in StackBlitz](https://stackblitz.com/github/lucia-auth/examples/tree/v3/astro/github-oauth).

```
npx degit https://github.com/lucia-auth/examples/tree/v3/astro/github-oauth <directory_name>
npx degit https://github.com/lucia-auth/examples/tree/main/astro/github-oauth <directory_name>
```

## Create an OAuth App
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/tutorials/github-oauth/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: "Tutorial: GitHub OAuth"

# Tutorial: GitHub OAuth

The tutorials go over how to implement a basic GitHub OAuth and cover the basics of Lucia along the way. As a prerequisite, you should be fairly comfortable with your framework and its APIs. Basic example projects are available in the [examples repository](https://github.com/lucia-auth/examples/tree/v3).
The tutorials go over how to implement a basic GitHub OAuth and cover the basics of Lucia along the way. As a prerequisite, you should be fairly comfortable with your framework and its APIs. Basic example projects are available in the [examples repository](https://github.com/lucia-auth/examples/tree/main).

- [Astro](/tutorials/github-oauth/astro)
- [Next.js App router](/tutorials/github-oauth/nextjs-app)
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/tutorials/github-oauth/nextjs-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ title: "GitHub OAuth in Next.js App router"

Before starting, make sure you've set up your database and middleware as described in the [Getting started](/getting-started/nextjs-app) page.

An [example project](https://github.com/lucia-auth/examples/tree/v3/nextjs-app/github-oauth) based on this tutorial is also available. You can clone the example locally or [open it in StackBlitz](https://stackblitz.com/github/lucia-auth/examples/tree/v3/nextjs-app/github-oauth).
An [example project](https://github.com/lucia-auth/examples/tree/main/nextjs-app/github-oauth) based on this tutorial is also available. You can clone the example locally or [open it in StackBlitz](https://stackblitz.com/github/lucia-auth/examples/tree/v3/nextjs-app/github-oauth).

```
npx degit https://github.com/lucia-auth/examples/tree/v3/nextjs-app/github-oauth <directory_name>
npx degit https://github.com/lucia-auth/examples/tree/main/nextjs-app/github-oauth <directory_name>
```

## Create an OAuth App
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/tutorials/github-oauth/nextjs-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ title: "GitHub OAuth in Next.js Pages router"

Before starting, make sure you've set up your database and middleware as described in the [Getting started](/getting-started/nextjs-pages) page.

An [example project](https://github.com/lucia-auth/examples/tree/v3/nextjs-pages/github-oauth) based on this tutorial is also available. You can clone the example locally or [open it in StackBlitz](https://stackblitz.com/github/lucia-auth/examples/tree/v3/nextjs-pages/github-oauth).
An [example project](https://github.com/lucia-auth/examples/tree/main/nextjs-pages/github-oauth) based on this tutorial is also available. You can clone the example locally or [open it in StackBlitz](https://stackblitz.com/github/lucia-auth/examples/tree/v3/nextjs-pages/github-oauth).

```
npx degit https://github.com/lucia-auth/examples/tree/v3/nextjs-pages/github-oauth <directory_name>
npx degit https://github.com/lucia-auth/examples/tree/main/nextjs-pages/github-oauth <directory_name>
```

## Create an OAuth App
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/tutorials/github-oauth/nuxt.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ title: "GitHub OAuth in Nuxt"

Before starting, make sure you've set up your database and middleware as described in the [Getting started](/getting-started/nuxt) page.

An [example project](https://github.com/lucia-auth/examples/tree/v3/nuxt/github-oauth) based on this tutorial is also available. You can clone the example locally or [open it in StackBlitz](https://stackblitz.com/github/lucia-auth/examples/tree/v3/nuxt/github-oauth).
An [example project](https://github.com/lucia-auth/examples/tree/main/nuxt/github-oauth) based on this tutorial is also available. You can clone the example locally or [open it in StackBlitz](https://stackblitz.com/github/lucia-auth/examples/tree/v3/nuxt/github-oauth).

```
npx degit https://github.com/lucia-auth/examples/tree/v3/nuxt/github-oauth <directory_name>
npx degit https://github.com/lucia-auth/examples/tree/main/nuxt/github-oauth <directory_name>
```

## Create an OAuth App
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/tutorials/github-oauth/sveltekit.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ title: "GitHub OAuth in SvelteKit"

Before starting, make sure you've set up your database and middleware as described in the [Getting started](/getting-started/sveltekit) page.

An [example project](https://github.com/lucia-auth/examples/tree/v3/sveltekit/github-oauth) based on this tutorial is also available. You can clone the example locally or [open it in StackBlitz](https://stackblitz.com/github/lucia-auth/examples/tree/v3/sveltekit/github-oauth).
An [example project](https://github.com/lucia-auth/examples/tree/main/sveltekit/github-oauth) based on this tutorial is also available. You can clone the example locally or [open it in StackBlitz](https://stackblitz.com/github/lucia-auth/examples/tree/v3/sveltekit/github-oauth).

```
npx degit https://github.com/lucia-auth/examples/tree/v3/sveltekit/github-oauth <directory_name>
npx degit https://github.com/lucia-auth/examples/tree/main/sveltekit/github-oauth <directory_name>
```

## Create an OAuth App
Expand Down
25 changes: 25 additions & 0 deletions docs/pages/tutorials/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: "Tutorials"
---

# Lucia Auth Tutorials

Explore our tutorials for implementing Lucia Auth with GitHub OAuth or traditional username and password authentication in Astro, SvelteKit, Nuxt, and Next.js.

## GitHub OAuth

Learn to set up GitHub OAuth, handle authentication, and manage user sessions.

- [Astro](/tutorials/github-oauth/astro)
- [SvelteKit](/tutorials/github-oauth/sveltekit)
- [Nuxt](/tutorials/github-oauth/nuxt)
- [Next.js](/tutorials/github-oauth/nextjs)

## Username and Password

Understand how to implement a secure username and password authentication system.

- [Astro](/tutorials/username-and-password/astro)
- [SvelteKit](/tutorials/username-and-password/sveltekit)
- [Nuxt](/tutorials/username-and-password/nuxt)
- [Next.js](/tutorials/username-and-password/nextjs)
4 changes: 2 additions & 2 deletions docs/pages/tutorials/username-and-password/astro.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ title: "Tutorial: Username and password auth in Astro"

Before starting, make sure you've set up your database and middleware as described in the [Getting started](/getting-started/astro) page.

An [example project](https://github.com/lucia-auth/examples/tree/v3/astro/username-and-password) based on this tutorial is also available. You can clone the example locally or [open it in StackBlitz](https://stackblitz.com/github/lucia-auth/examples/tree/v3/astro/username-and-password).
An [example project](https://github.com/lucia-auth/examples/tree/main/astro/username-and-password) based on this tutorial is also available. You can clone the example locally or [open it in StackBlitz](https://stackblitz.com/github/lucia-auth/examples/tree/v3/astro/username-and-password).

```
npx degit https://github.com/lucia-auth/examples/tree/v3/astro/username-and-password <directory_name>
npx degit https://github.com/lucia-auth/examples/tree/main/astro/username-and-password <directory_name>
```

## Update database
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/tutorials/username-and-password/nextjs-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ title: "Username and password auth in Next.js App Router"

Before starting, make sure you've set up your database as described in the [Getting started](/getting-started/nextjs-app) page.

An [example project](https://github.com/lucia-auth/examples/tree/v3/nextjs-app/username-and-password) based on this tutorial is also available. You can clone the example locally or [open it in StackBlitz](https://stackblitz.com/github/lucia-auth/examples/tree/v3/nextjs-app/username-and-password).
An [example project](https://github.com/lucia-auth/examples/tree/main/nextjs-app/username-and-password) based on this tutorial is also available. You can clone the example locally or [open it in StackBlitz](https://stackblitz.com/github/lucia-auth/examples/tree/v3/nextjs-app/username-and-password).

```
npx degit https://github.com/lucia-auth/examples/tree/v3/nextjs-app/username-and-password <directory_name>
npx degit https://github.com/lucia-auth/examples/tree/main/nextjs-app/username-and-password <directory_name>
```

## Update database
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/tutorials/username-and-password/nextjs-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ title: "Tutorial: Username and password auth in Next.js Pages router"

Before starting, make sure you've set up your database and middleware as described in the [Getting started](/getting-started/nextjs-pages) page.

An [example project](https://github.com/lucia-auth/examples/tree/v3/nextjs-pages/username-and-password) based on this tutorial is also available. You can clone the example locally or [open it in StackBlitz](https://stackblitz.com/github/lucia-auth/examples/tree/v3/nextjs-pages/username-and-password).
An [example project](https://github.com/lucia-auth/examples/tree/main/nextjs-pages/username-and-password) based on this tutorial is also available. You can clone the example locally or [open it in StackBlitz](https://stackblitz.com/github/lucia-auth/examples/tree/v3/nextjs-pages/username-and-password).

```
npx degit https://github.com/lucia-auth/examples/tree/v3/nextjs-pages/username-and-password <directory_name>
npx degit https://github.com/lucia-auth/examples/tree/main/nextjs-pages/username-and-password <directory_name>
```

## Update database
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/tutorials/username-and-password/nuxt.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ title: "Tutorial: Username and password auth in Nuxt"

Before starting, make sure you've set up your database and middleware as described in the [Getting started](/getting-started/nuxt) page.

An [example project](https://github.com/lucia-auth/examples/tree/v3/nuxt/username-and-password) based on this tutorial is also available. You can clone the example locally or [open it in StackBlitz](https://stackblitz.com/github/lucia-auth/examples/tree/v3/nuxt/username-and-password).
An [example project](https://github.com/lucia-auth/examples/tree/main/nuxt/username-and-password) based on this tutorial is also available. You can clone the example locally or [open it in StackBlitz](https://stackblitz.com/github/lucia-auth/examples/tree/v3/nuxt/username-and-password).

```
npx degit https://github.com/lucia-auth/examples/tree/v3/nuxt/username-and-password <directory_name>
npx degit https://github.com/lucia-auth/examples/tree/main/nuxt/username-and-password <directory_name>
```

## Update database
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/tutorials/username-and-password/sveltekit.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ title: "Tutorial: Username and password auth in SvelteKit"

Before starting, make sure you've set up your database and middleware as described in the [Getting started](/getting-started/astro) page.

An [example project](https://github.com/lucia-auth/examples/tree/v3/sveltekit/username-and-password) based on this tutorial is also available. You can clone the example locally or [open it in StackBlitz](https://stackblitz.com/github/lucia-auth/examples/tree/v3/sveltekit/username-and-password).
An [example project](https://github.com/lucia-auth/examples/tree/main/sveltekit/username-and-password) based on this tutorial is also available. You can clone the example locally or [open it in StackBlitz](https://stackblitz.com/github/lucia-auth/examples/tree/v3/sveltekit/username-and-password).

```
npx degit https://github.com/lucia-auth/examples/tree/v3/sveltekit/username-and-password <directory_name>
npx degit https://github.com/lucia-auth/examples/tree/main/sveltekit/username-and-password <directory_name>
```

## Update database
Expand Down

0 comments on commit b78a2bb

Please sign in to comment.