Skip to content

Commit b3a909e

Browse files
Copilothotlong
andcommitted
Restructure as core spec: Rename to Authentication protocol (generic, not BetterAuth)
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent e8f0d88 commit b3a909e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+3288
-746
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
title: AccountLinkingConfig
3+
description: AccountLinkingConfig Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **enabled** | `boolean` | optional | Allow account linking |
11+
| **autoLink** | `boolean` | optional | Automatically link accounts with same email |
12+
| **requireVerification** | `boolean` | optional | Require email verification before linking |
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
title: AuthPluginConfig
3+
description: AuthPluginConfig Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **name** | `string` || Plugin name |
11+
| **enabled** | `boolean` | optional | |
12+
| **options** | `Record<string, any>` | optional | Plugin-specific options |
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: AuthStrategy
3+
description: AuthStrategy Schema Reference
4+
---
5+
6+
## Allowed Values
7+
8+
* `email_password`
9+
* `magic_link`
10+
* `oauth`
11+
* `passkey`
12+
* `otp`
13+
* `anonymous`
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: AuthenticationConfig
3+
description: AuthenticationConfig Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **name** | `string` || Configuration name (snake_case) |
11+
| **label** | `string` || Display label |
12+
| **strategies** | `Enum<'email_password' \| 'magic_link' \| 'oauth' \| 'passkey' \| 'otp' \| 'anonymous'>[]` || Enabled authentication strategies |
13+
| **baseUrl** | `string` || Application base URL |
14+
| **secret** | `string` || Secret key for signing (min 32 chars) |
15+
| **emailPassword** | `object` | optional | |
16+
| **magicLink** | `object` | optional | |
17+
| **passkey** | `object` | optional | |
18+
| **oauth** | `object` | optional | |
19+
| **session** | `object` | optional | |
20+
| **rateLimit** | `object` | optional | |
21+
| **csrf** | `object` | optional | |
22+
| **accountLinking** | `object` | optional | |
23+
| **twoFactor** | `object` | optional | |
24+
| **userFieldMapping** | `object` | optional | |
25+
| **database** | `object` | optional | |
26+
| **plugins** | `object[]` | optional | |
27+
| **hooks** | `object` | optional | Authentication lifecycle hooks |
28+
| **security** | `object` | optional | Advanced security settings |
29+
| **email** | `object` | optional | Email configuration |
30+
| **ui** | `object` | optional | UI customization |
31+
| **active** | `boolean` | optional | Whether this provider is active |
32+
| **allowRegistration** | `boolean` | optional | Allow new user registration |
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: AuthenticationProvider
3+
description: AuthenticationProvider Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **type** | `string` || Provider type identifier |
11+
| **config** | `object` || Authentication configuration |
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: CSRFConfig
3+
description: CSRFConfig Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **enabled** | `boolean` | optional | |
11+
| **tokenLength** | `number` | optional | CSRF token length |
12+
| **cookieName** | `string` | optional | CSRF cookie name |
13+
| **headerName** | `string` | optional | CSRF header name |
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: DatabaseAdapter
3+
description: DatabaseAdapter Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **type** | `Enum<'prisma' \| 'drizzle' \| 'kysely' \| 'custom'>` || Database adapter type |
11+
| **connectionString** | `string` | optional | Database connection string |
12+
| **tablePrefix** | `string` | optional | Prefix for auth tables |
13+
| **schema** | `string` | optional | Database schema name |
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: EmailPasswordConfig
3+
description: EmailPasswordConfig Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **enabled** | `boolean` | optional | |
11+
| **requireEmailVerification** | `boolean` | optional | Require email verification before login |
12+
| **minPasswordLength** | `number` | optional | Minimum password length |
13+
| **requirePasswordComplexity** | `boolean` | optional | Require uppercase, lowercase, numbers, symbols |
14+
| **allowPasswordReset** | `boolean` | optional | Enable password reset functionality |
15+
| **passwordResetExpiry** | `number` | optional | Password reset token expiry in seconds |
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: MagicLinkConfig
3+
description: MagicLinkConfig Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **enabled** | `boolean` | optional | |
11+
| **expiryTime** | `number` | optional | Magic link expiry time in seconds (default 15 min) |
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: OAuthProvider
3+
description: OAuthProvider Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **provider** | `Enum<'google' \| 'github' \| 'facebook' \| 'twitter' \| 'linkedin' \| 'microsoft' \| 'apple' \| 'discord' \| 'gitlab' \| 'custom'>` || OAuth provider type |
11+
| **clientId** | `string` || OAuth client ID |
12+
| **clientSecret** | `string` || OAuth client secret (typically from ENV) |
13+
| **scopes** | `string[]` | optional | Requested OAuth scopes |
14+
| **redirectUri** | `string` | optional | OAuth callback URL |
15+
| **enabled** | `boolean` | optional | Whether this provider is enabled |
16+
| **displayName** | `string` | optional | Display name for the provider button |
17+
| **icon** | `string` | optional | Icon URL or identifier |

0 commit comments

Comments
 (0)