Resend Environment and Files
RESEND_API_KEY=
EMAIL_FROM=
- lib/email.js
- actions/email.ts
- lib/account-delete-verification.ts
- lib/org-delete-verification.ts
How Email Is Used in This Project
The codebase currently contains branded sender values like Jampack <noreply@hencework.com> and Workspace Security <noreply@hencework.com>, so replace those before launch.
- Organization invite emails
- Ad hoc email sending in the email app
- Account delete OTP emails
- Organization delete OTP emails
Redis Environment and Files
UPSTASH_REDIS_REST_URL=
UPSTASH_REDIS_REST_TOKEN=
- lib/redis.ts
- app/api/redis-test/route.ts
- lib/account-delete-verification.ts
- lib/org-delete-verification.ts
How OTP Verification Works
This pattern is used for both account delete and organization delete flows.
- A six-digit OTP is generated.
- The OTP is hashed and stored in Redis with a 10 minute TTL.
- A cooldown key is stored for 60 seconds to block rapid resends.
- Verification allows up to 5 attempts.
- On success, a short-lived verified token is stored and later consumed.
How to Test Redis in the Project
This route uses getCache() and setCache() from lib/redis.ts.
- GET /api/redis-test?key=demo
- POST /api/redis-test with { "key": "demo", "value": { "ok": true }, "ttlSeconds": 60 }
Verification Checklist
- Send one invite email.
- Use the email app send flow once.
- Request an account delete OTP.
- Request an organization delete OTP.
- Confirm cooldown and wrong-attempt behavior.