@@ -32,8 +32,10 @@ const alertsClient = singleton(
32
32
) ;
33
33
34
34
function 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
+ ) ;
37
39
38
40
switch ( transportType ) {
39
41
case "aws-ses" :
@@ -43,8 +45,8 @@ function buildTransportOptions(alerts?: boolean): MailTransportOptions {
43
45
type : "resend" ,
44
46
config : {
45
47
apiKey : alerts ? env . ALERT_RESEND_API_KEY : env . RESEND_API_KEY ,
46
- }
47
- }
48
+ } ,
49
+ } ;
48
50
case "smtp" :
49
51
return {
50
52
type : "smtp" ,
@@ -54,20 +56,20 @@ function buildTransportOptions(alerts?: boolean): MailTransportOptions {
54
56
secure : alerts ? env . ALERT_SMTP_SECURE : env . SMTP_SECURE ,
55
57
auth : {
56
58
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
+ } ,
60
62
} ;
61
63
default :
62
64
return { type : undefined } ;
63
65
}
64
66
}
65
67
66
68
export 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
+ // }
71
73
72
74
logger . debug ( "Sending magic link email" , { emailAddress : options . emailAddress } ) ;
73
75
0 commit comments