Skip to content

Commit e31f4cb

Browse files
feat: better-auth setup, github provider (#5)
* feat: better-auth setup, github provider * chore: update .env.example * feat: add TRUSTED_ORIGINS as env * feat(auth): add cookie cache * feat(pkg): export AUTH_PATH
1 parent 10a3ca0 commit e31f4cb

File tree

13 files changed

+361
-10
lines changed

13 files changed

+361
-10
lines changed

backend/.env.example

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1+
# PUBLIC_URL="" # set up this value when deploying on a domain (without trailing slash). default to http://localhost:PORT
2+
# PORT="" # you can change the server port if you want. default to 3000
3+
# TRUSTED_ORIGINS="" # comma-separated list of allowed origins. default to http://localhost:3000,3001,3002,5173,5174,5175
4+
15
DB_HOST=""
26
DB_PORT=""
37
DB_USER=""
48
DB_PASS=""
59
DB_NAME="polinetwork_backend"
10+
11+
# you generate it with `openssl rand -hex 20`
12+
BETTER_AUTH_SECRET=""
13+
# github provider https://www.better-auth.com/docs/authentication/github
14+
GITHUB_CLIENT_ID=""
15+
GITHUB_CLIENT_SECRET=""

backend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"@hono/trpc-server": "^0.3.4",
3232
"@t3-oss/env-core": "^0.12.0",
3333
"@trpc/server": "11.0.0-rc.772",
34+
"better-auth": "^1.2.7",
3435
"drizzle-orm": "^0.39.3",
3536
"hono": "^4.7.6",
3637
"pg": "^8.13.2",

0 commit comments

Comments
 (0)