@@ -32,8 +32,10 @@ const alertsClient = singleton(
3232) ;
3333
3434function buildTransportOptions ( alerts ?: boolean ) : MailTransportOptions {
35- const transportType = alerts ? env . ALERT_EMAIL_TRANSPORT : env . EMAIL_TRANSPORT
36- logger . debug ( `Constructing email transport '${ transportType } ' for usage '${ alerts ?'alerts' :'general' } '` )
35+ const transportType = alerts ? env . ALERT_EMAIL_TRANSPORT : env . EMAIL_TRANSPORT ;
36+ logger . debug (
37+ `Constructing email transport '${ transportType } ' for usage '${ alerts ? "alerts" : "general" } '`
38+ ) ;
3739
3840 switch ( transportType ) {
3941 case "aws-ses" :
@@ -43,8 +45,8 @@ function buildTransportOptions(alerts?: boolean): MailTransportOptions {
4345 type : "resend" ,
4446 config : {
4547 apiKey : alerts ? env . ALERT_RESEND_API_KEY : env . RESEND_API_KEY ,
46- }
47- }
48+ } ,
49+ } ;
4850 case "smtp" :
4951 return {
5052 type : "smtp" ,
@@ -54,20 +56,20 @@ function buildTransportOptions(alerts?: boolean): MailTransportOptions {
5456 secure : alerts ? env . ALERT_SMTP_SECURE : env . SMTP_SECURE ,
5557 auth : {
5658 user : alerts ? env . ALERT_SMTP_USER : env . SMTP_USER ,
57- pass : alerts ? env . ALERT_SMTP_PASSWORD : env . SMTP_PASSWORD
58- }
59- }
59+ pass : alerts ? env . ALERT_SMTP_PASSWORD : env . SMTP_PASSWORD ,
60+ } ,
61+ } ,
6062 } ;
6163 default :
6264 return { type : undefined } ;
6365 }
6466}
6567
6668export async function sendMagicLinkEmail ( options : SendEmailOptions < AuthUser > ) : Promise < void > {
67- // Auto redirect when in development mode
68- if ( env . NODE_ENV === "development" ) {
69- throw redirect ( options . magicLink ) ;
70- }
69+ // // Auto redirect when in development mode
70+ // if (env.NODE_ENV === "development") {
71+ // throw redirect(options.magicLink);
72+ // }
7173
7274 logger . debug ( "Sending magic link email" , { emailAddress : options . emailAddress } ) ;
7375
0 commit comments