You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/plugins/plugin-auth/README.md
+71-8Lines changed: 71 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
Authentication & Identity Plugin for ObjectStack.
4
4
5
-
> **✨ Status:**Better-Auth library successfully integrated! Core authentication structure is in place with better-auth v1.4.18. Full API integration and advanced features are in active development.
5
+
> **✨ Status:**ObjectQL-based authentication implementation! Uses ObjectQL for data persistence (no third-party ORM required). Core authentication structure is in place with better-auth v1.4.18.
6
6
7
7
## Features
8
8
@@ -12,6 +12,7 @@ Authentication & Identity Plugin for ObjectStack.
12
12
- ✅ Service registration in ObjectKernel
13
13
- ✅ Configuration schema support
14
14
- ✅ **Better-Auth library integration (v1.4.18)**
15
+
- ✅ **ObjectQL-based database implementation (no ORM required)**
15
16
- ✅ **Direct request forwarding to better-auth handler**
16
17
- ✅ **Wildcard routing (`/api/v1/auth/*`)**
17
18
- ✅ **Full better-auth API access via `auth.api`**
@@ -28,10 +29,17 @@ Authentication & Identity Plugin for ObjectStack.
The plugin uses [better-auth](https://www.better-auth.com/) for robust, production-ready authentication functionality. All requests are forwarded directly to better-auth's universal handler, ensuring full compatibility with all better-auth features.
42
+
The plugin uses [better-auth](https://www.better-auth.com/) for robust, production-ready authentication functionality. All requests are forwarded directly to better-auth's universal handler, ensuring full compatibility with all better-auth features. Data persistence is handled by ObjectQL, adhering to ObjectStack's "Data as Code" philosophy.
// ObjectQL will be automatically injected by the kernel
56
68
providers: [
57
69
{
58
70
id: 'google',
@@ -65,13 +77,14 @@ const kernel = new ObjectKernel({
65
77
});
66
78
```
67
79
80
+
**Note:** The `databaseUrl` parameter is no longer used. The plugin now uses ObjectQL's IDataEngine interface, which is provided by the kernel's `data` service. This allows the plugin to work with any ObjectQL-compatible driver (memory, SQL, NoSQL, etc.) without requiring a specific ORM.
81
+
68
82
### With Organization Support
69
83
70
84
```typescript
71
85
newAuthPlugin({
72
86
secret: process.env.AUTH_SECRET,
73
87
baseUrl: 'http://localhost:3000',
74
-
databaseUrl: process.env.DATABASE_URL,
75
88
plugins: {
76
89
organization: true, // Enable organization/teams
77
90
twoFactor: true, // Enable 2FA
@@ -142,10 +155,12 @@ This package provides authentication services powered by better-auth. Current im
142
155
7. ✅ Full better-auth API support
143
156
8. ✅ OAuth providers (configurable)
144
157
9. ✅ 2FA, passkeys, magic links (configurable)
145
-
10.🔄 Database adapter integration (in progress)
158
+
10.✅ ObjectQL-based database implementation (no ORM required)
146
159
147
160
### Architecture
148
161
162
+
#### Request Flow
163
+
149
164
The plugin uses a **direct forwarding** approach:
150
165
151
166
```typescript
@@ -164,6 +179,54 @@ This architecture provides:
164
179
- ✅ **Type safety** - Full TypeScript support from better-auth
165
180
- ✅ **Programmatic API** - Access auth methods via `authManager.api`
166
181
182
+
#### ObjectQL Database Architecture
183
+
184
+
The plugin uses **ObjectQL** for data persistence instead of third-party ORMs:
0 commit comments