major: Migration from better-auth to keycloak

This commit is contained in:
2025-10-28 10:40:38 +01:00
parent e5e063bbde
commit 36364a7977
77 changed files with 1444 additions and 2930 deletions

View File

@@ -1,39 +1,3 @@
# Legal Consent Hub
## Setup
1. Create `.env` file with these variables:
```
BETTER_AUTH_URL=http://localhost:3000
BETTER_AUTH_SECRET=YOUR_SECRET
```
2. Generate database schema: `pnpm dlx @better-auth/cli generate`
3. Migrate schema: `pnpm dlx @better-auth/cli migrate`
## Common errors
### better-auth/cli generate
```
Couldn't read your auth config. Error: Could not locate the bindings file. Tried:
```
**Solution:** I was able to resolve by running npx node-gyp rebuild in 'node_modules/better-sqlite3'
https://github.com/WiseLibs/better-sqlite3/issues/1320
https://github.com/WiseLibs/better-sqlite3/issues/146
### This version of Node.js requires NODE_MODULE_VERSION 131.
```
rm -fr node_modules; pnpm store prune
```
https://github.com/elizaOS/eliza/pull/665
### Unauthorized /token and /organization/list endpoints
User needs to be logged in to access these endpoints.
https://www.better-auth.com/docs/plugins/organization#accept-invitation