fix: signup (#25334)

* Handle Stripe logic in `paymentCallback`

* Remove endpoint

* Do not send email verification email if premium username

* Remove logic from verify-view

* Callback send verification email

* Add `create` method to `VerificationToken` repository

* Create `VerificationTokenService`

* Early return if payment failed

* Refactor token generation

* Add tests

* Type fixes

* Type fixes
This commit is contained in:
Joe Au-Yeung authored and GitHub committed 2025-11-21 19:51:19 +00:00
1 parent 06348982a3
commit e5ebf7feb4
12 files changed
+714 -104

No files matched your search

@@ -12,7 +12,10 @@ const transporter = nodemailer.createTransport<TransportOptions>({
...(serverConfig.transport as TransportOptions),
} as TransportOptions);
const sendVerificationRequest = async ({ identifier, url }: SendVerificationRequestParams) => {
const sendVerificationRequest = async ({
identifier,
url,
}: Pick<SendVerificationRequestParams, "identifier" | "url">) => {
const emailsDir = path.resolve(process.cwd(), "..", "..", "packages/emails", "templates");
const originalUrl = new URL(url);
const webappUrl = new URL(process.env.NEXTAUTH_URL || WEBAPP_URL);