Brings the working codebase (Next.js app, auth system, Stripe billing, Docker/deploy config, tests, docs) into version control on top of the placeholder initial commit, and adds account self-deletion (Danger Zone in Settings, password + typed-email confirmation, cascading DB cleanup, Stripe cancellation) per GDPR right-to-erasure. Excludes local build caches, node_modules, and internal agent scratch files; .gitignore hardened to keep those out going forward. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
37 lines
1.4 KiB
TypeScript
37 lines
1.4 KiB
TypeScript
/**
|
|
* Loads `.env.local` as a side effect on import.
|
|
*
|
|
* This has to be its own module: ES module imports are hoisted, so calling
|
|
* `process.loadEnvFile()` at the top of a file that also imports the database
|
|
* module would run *after* that module had already read `DATABASE_URL`. Imported
|
|
* first, this module is evaluated first.
|
|
*
|
|
* It matters because the fallback connection string targets port 5432, which on
|
|
* a development machine is quite likely another project's database.
|
|
*/
|
|
try {
|
|
process.loadEnvFile(".env.local");
|
|
} catch {
|
|
// No .env.local (CI, fresh clone): use the environment as given.
|
|
}
|
|
|
|
/**
|
|
* Hard guarantee that the suite never sends mail.
|
|
*
|
|
* The fixtures operate on fabricated addresses (`authtest-…@gmail.com`), and a
|
|
* configured SMTP server would dutifully try to deliver to them — bouncing off
|
|
* real providers and burning the sending domain's reputation. Clearing these
|
|
* puts the mailer into its development fallback, which returns the link instead
|
|
* of sending it, which is also how the tests get hold of the raw token.
|
|
*/
|
|
delete process.env.SMTP_HOST;
|
|
delete process.env.SMTP_USER;
|
|
delete process.env.SMTP_PASSWORD;
|
|
|
|
// The dev fallback throws in production rather than silently not sending.
|
|
if (process.env.NODE_ENV === "production") {
|
|
throw new Error("Refusing to run the auth integration suite with NODE_ENV=production");
|
|
}
|
|
|
|
export {};
|