mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-08-23 23:02:17 +10:00
refactor: ponytail audit
This commit is contained in:
@@ -1,15 +1,7 @@
|
||||
import { ResetPasswordEmail } from "./auth";
|
||||
|
||||
interface ResetPasswordTemplateProps {
|
||||
url: string;
|
||||
}
|
||||
|
||||
const ResetPasswordTemplate = ({ url }: ResetPasswordTemplateProps) => {
|
||||
return <ResetPasswordEmail url={url} />;
|
||||
};
|
||||
|
||||
export default Object.assign(ResetPasswordTemplate, {
|
||||
export default Object.assign(ResetPasswordEmail, {
|
||||
PreviewProps: {
|
||||
url: "https://localhost:3000/auth/reset-password?token=example-token",
|
||||
} satisfies ResetPasswordTemplateProps,
|
||||
} satisfies Parameters<typeof ResetPasswordEmail>[0],
|
||||
});
|
||||
|
||||
@@ -1,19 +1,9 @@
|
||||
import { VerifyEmailChange } from "./auth";
|
||||
|
||||
interface VerifyEmailChangeTemplateProps {
|
||||
url: string;
|
||||
previousEmail: string;
|
||||
newEmail: string;
|
||||
}
|
||||
|
||||
const VerifyEmailChangeTemplate = ({ url, previousEmail, newEmail }: VerifyEmailChangeTemplateProps) => {
|
||||
return <VerifyEmailChange url={url} previousEmail={previousEmail} newEmail={newEmail} />;
|
||||
};
|
||||
|
||||
export default Object.assign(VerifyEmailChangeTemplate, {
|
||||
export default Object.assign(VerifyEmailChange, {
|
||||
PreviewProps: {
|
||||
url: "https://localhost:3000/auth/verify-email-change?token=example-token",
|
||||
previousEmail: "old@example.com",
|
||||
newEmail: "new@example.com",
|
||||
} satisfies VerifyEmailChangeTemplateProps,
|
||||
} satisfies Parameters<typeof VerifyEmailChange>[0],
|
||||
});
|
||||
|
||||
@@ -1,15 +1,7 @@
|
||||
import { VerifyEmail } from "./auth";
|
||||
|
||||
interface VerifyEmailTemplateProps {
|
||||
url: string;
|
||||
}
|
||||
|
||||
const VerifyEmailTemplate = ({ url }: VerifyEmailTemplateProps) => {
|
||||
return <VerifyEmail url={url} />;
|
||||
};
|
||||
|
||||
export default Object.assign(VerifyEmailTemplate, {
|
||||
export default Object.assign(VerifyEmail, {
|
||||
PreviewProps: {
|
||||
url: "https://localhost:3000/auth/verify-email?token=example-token",
|
||||
} satisfies VerifyEmailTemplateProps,
|
||||
} satisfies Parameters<typeof VerifyEmail>[0],
|
||||
});
|
||||
|
||||
@@ -13,17 +13,14 @@ type SendEmailOptions = {
|
||||
from?: string;
|
||||
};
|
||||
|
||||
const isSmtpEnabled = () => {
|
||||
return !!env.SMTP_HOST && !!env.SMTP_USER && !!env.SMTP_PASS && !!env.SMTP_FROM;
|
||||
};
|
||||
const isSmtpEnabled = () => !!env.SMTP_HOST && !!env.SMTP_USER && !!env.SMTP_PASS && !!env.SMTP_FROM;
|
||||
|
||||
let cachedTransport: Transporter | undefined;
|
||||
|
||||
const getTransport = () => {
|
||||
if (!isSmtpEnabled()) return;
|
||||
if (cachedTransport) return cachedTransport;
|
||||
|
||||
cachedTransport = nodemailer.createTransport({
|
||||
cachedTransport ??= nodemailer.createTransport({
|
||||
host: env.SMTP_HOST,
|
||||
port: env.SMTP_PORT,
|
||||
secure: env.SMTP_SECURE,
|
||||
|
||||
Reference in New Issue
Block a user