Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions 24 apps/webapp/app/services/email.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ const alertsClient = singleton(
);

function buildTransportOptions(alerts?: boolean): MailTransportOptions {
const transportType = alerts ? env.ALERT_EMAIL_TRANSPORT : env.EMAIL_TRANSPORT
logger.debug(`Constructing email transport '${transportType}' for usage '${alerts?'alerts':'general'}'`)
const transportType = alerts ? env.ALERT_EMAIL_TRANSPORT : env.EMAIL_TRANSPORT;
logger.debug(
`Constructing email transport '${transportType}' for usage '${alerts ? "alerts" : "general"}'`
);

switch (transportType) {
case "aws-ses":
Expand All @@ -43,8 +45,8 @@ function buildTransportOptions(alerts?: boolean): MailTransportOptions {
type: "resend",
config: {
apiKey: alerts ? env.ALERT_RESEND_API_KEY : env.RESEND_API_KEY,
}
}
},
};
case "smtp":
return {
type: "smtp",
Expand All @@ -54,20 +56,20 @@ function buildTransportOptions(alerts?: boolean): MailTransportOptions {
secure: alerts ? env.ALERT_SMTP_SECURE : env.SMTP_SECURE,
auth: {
user: alerts ? env.ALERT_SMTP_USER : env.SMTP_USER,
pass: alerts ? env.ALERT_SMTP_PASSWORD : env.SMTP_PASSWORD
}
}
pass: alerts ? env.ALERT_SMTP_PASSWORD : env.SMTP_PASSWORD,
},
},
};
default:
return { type: undefined };
}
}

export async function sendMagicLinkEmail(options: SendEmailOptions<AuthUser>): Promise<void> {
// Auto redirect when in development mode
if (env.NODE_ENV === "development") {
throw redirect(options.magicLink);
}
// // Auto redirect when in development mode
// if (env.NODE_ENV === "development") {
// throw redirect(options.magicLink);
// }

logger.debug("Sending magic link email", { emailAddress: options.emailAddress });

Expand Down
2 changes: 1 addition & 1 deletion 2 apps/webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
"recharts": "^2.12.6",
"regression": "^2.0.1",
"remix-auth": "^3.6.0",
"remix-auth-email-link": "2.0.2",
"remix-auth-email-link": "2.1.1",
"remix-auth-github": "^1.6.0",
"remix-typedjson": "0.3.1",
"remix-utils": "^7.1.0",
Expand Down
18 changes: 7 additions & 11 deletions 18 pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.