Skip to content

Commit a58e6b1

Browse files
enijarclaude
andcommitted
feat: wire up cookie auth and complete the password reset flow
Implement the previously scaffolded auth. Login issues a JWT in an httpOnly cookie, the tRPC context verifies it, and a privateProcedure guards authenticated queries. Add logout and me procedures, and hydrate client user state on load. Build out password reset properly. Store a hashed, single-use token with a one-hour expiry, email the raw token, and add a completion endpoint plus a /reset-password page to set a new password. The request endpoint no longer reveals whether an email is registered. Harden and tidy up alongside: - restrict CORS to APP_URL with credentials - honour BASE_PATH in the router basename and the tRPC URL - type-check vite.config.ts and format the whole repo via .prettierignore - portable build:server clean and removal of unused dependencies - accessibility fixes (zoom, input labels) and assorted cleanups Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 1ff61f7 commit a58e6b1

29 files changed

Lines changed: 334 additions & 78 deletions

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ DATABASE_DIALECT=sqlite3
66
DATABASE_URL=sqlite3:database.sqlite
77
JWT_SECRET=secret
88
EMAIL_FROM=hello@example.com
9-
EMAIL_SMTP_API_KEY=secret
9+
EMAIL_SMTP_API_KEY=SG.secret
1010
BASE_PATH=/

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
build
3+
package-lock.json
4+
.idea

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ npm run build
2525
pm2 startOrReload ecosystem.config.cjs --time --update-env
2626
```
2727

28+
The CI workflow builds on the GitHub runner, rsyncs `build` and `node_modules` to the server, then reloads pm2. Because `node_modules` is copied as-is, the runner and the server must share the same OS and CPU architecture so native modules such as `argon2` stay compatible. If they differ, run `npm rebuild` on the server after syncing, or change the workflow to run `npm ci` on the server instead.
29+
2830
Example NGINX config:
2931

3032
```nginx configuration

0 commit comments

Comments
 (0)