Skip to content

Commit

Permalink
feat: run sendAuthVerificationEmail sync, so people dont have to wait…
Browse files Browse the repository at this point in the history
… for it
  • Loading branch information
dahal committed May 19, 2024
1 parent 4268279 commit 50756d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/trpc/routers/auth/procedure/resend-email.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AuthVerificationEmailJob } from "@/jobs/auth-verification-email";
import { sendAuthVerificationEmail } from "@/jobs/auth-verification-email";

import { generateVerificationToken } from "@/lib/token";
import { getVerificationTokenByEmail } from "@/server/verification-token";
Expand All @@ -19,10 +19,11 @@ export const resendEmailProcedure = withoutAuth
}
const verificationToken = await generateVerificationToken(input);

await new AuthVerificationEmailJob().emit({
await sendAuthVerificationEmail({
email: verificationToken.identifier,
token: verificationToken.token,
});

return {
success: true,
message:
Expand Down
4 changes: 2 additions & 2 deletions src/trpc/routers/auth/procedure/signup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AuthVerificationEmailJob } from "@/jobs/auth-verification-email";
import { sendAuthVerificationEmail } from "@/jobs/auth-verification-email";

import { generateVerificationToken } from "@/lib/token";
import { withoutAuth } from "@/trpc/api/trpc";
Expand Down Expand Up @@ -35,7 +35,7 @@ export const signupProcedure = withoutAuth
});
const verificationToken = await generateVerificationToken(email);

await new AuthVerificationEmailJob().emit({
await sendAuthVerificationEmail({
email: verificationToken.identifier,
token: verificationToken.token,
});
Expand Down

0 comments on commit 50756d5

Please sign in to comment.