minimal better-auth oauth example with react-router v6, NO nextjs/react-query/tanstack/...
- Create an Application with Provider
- In the OAuth application config
- Name (e.g., sample)
- Scope (email, openid, profile)
- Redirect URIs like:
npm i
# start pg db; you can also use local sqlite here `apps/backend/src/lib/auth.ts`
docker compose up -d
# init database schema
cd sso-better-auth/apps/backend/
cp .env.sample .env
npx @better-auth/cli generate --output src/db/schema.ts
npx drizzle-kit push
# start full stack app
cd sso-better-auth/
npx nx run backend:serve
npx nx run web-app:serve- webapp: http://localhost:4200
- server: http://localhost:8800
MIT