| 101 | .digest("hex"); |
| 102 | |
| 103 | const sendMobileEmailCode = async (email: string, code: string) => { |
| 104 | if (!serverEnv().RESEND_API_KEY) { |
| 105 | if (process.env.NODE_ENV === "production") { |
| 106 | throw new Error("RESEND_API_KEY is required to send mobile email codes"); |
| 107 | } |
| 108 | console.log(""); |
| 109 | console.log("Cap mobile verification code"); |
| 110 | console.log(`Email: ${email}`); |
| 111 | console.log(`Code: ${code}`); |
| 112 | console.log("Expires in: 10 minutes"); |
| 113 | console.log(""); |
| 114 | return; |
| 115 | } |
| 116 | |
| 117 | await sendEmail({ |
| 118 | email, |
| 119 | subject: "Your Cap Verification Code", |
| 120 | react: OTPEmail({ code, email }), |
| 121 | }); |
| 122 | }; |
| 123 | |
| 124 | const getMobileRedirectUrl = (redirectUri: string) => { |
| 125 | try { |