Getting the following error when trying to send a verification e-mail: ```[INFO] 05:38:57 ts-node-d...
c
Getting the following error when trying to send a verification e-mail:
Copy code
[INFO] 05:38:57 ts-node-dev ver. 2.0.0 (using ts-node ver. 10.9.2, typescript ver. 4.9.5)
API Server listening on port 3001
Error: 140384285034368:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332:
where my smtp settings are:
Copy code
ts
let smtpSettings = {
    host: "mail.privateemail.com",
    authUsername: "no-reply@website.com",
    password: "password",
    port: 587,
    from: {
        name: "Website No Reply",
        email: "no-reply@website.com"
    },
    secure: true
}
Tried switching to port 465 as well but that times out the connection w/ a 504 error and has the following server side error after 2 minutes:
Copy code
Error: Connection timeout
    at SMTPConnection._formatError (/app/node_modules/nodemailer/lib/smtp-connection/index.js:790:19)
    at SMTPConnection._onError (/app/node_modules/nodemailer/lib/smtp-connection/index.js:776:20)
    at Timeout.<anonymous> (/app/node_modules/nodemailer/lib/smtp-connection/index.js:235:22)
    at listOnTimeout (internal/timers.js:557:17)
    at processTimers (internal/timers.js:500:7)
I tried testing it in java like so and this does work: Ran some [tests]() on . so not sure what I'm doing entirely wrong on the NodeJS back end not sure if relevant at all but I am using NameCheap's mail service (
privateemail.com
) with the DNS handled through Cloudflare. Followed the instructions Namecheap provides [here]() & [here]() Hope that's everything you might need to assist me with my issue
r
hey @corgitaco
@kakashi_44 can help here.
c
Hii
Alrighty
If there's anything else I could provide Kakashi lmk!
k
Hi @corgitaco , let me check
c
Any ideas?
k
Hi, not able to find anything on this rn. Will get back to you if we find anything
r
You can try seeing the custom email sending method in our docs.
In the email delivery section
That allows you to send emails using any lib / method
c
got a link??
also not sure if this helps at all but:
r
which recipe are you using?
c
NodeJs for back end, no front end yet but that will be handled manually with direct CDI calls
r
which recipe?
c
ohhhh
r
also, frontend should not call CDI APIs. It should call FDI APIs.
c
Copy code
ts
    recipeList: [
        EmailPassword.init({

            emailDelivery: {
                service: new SMTPService({ smtpSettings })
            },
        }), // initializes signin / sign up features
        ThirdPartyEmailPassword.init({
            // We have provided you with development keys which you can use for testing.
            // IMPORTANT: Please replace them with your own OAuth keys for production use.
            providers: [{
                config: {
                    thirdPartyId: "google",
                    clients: [{
                        clientId: "1060725074195-kmeum4crr01uirfl2op9kd5acmi9jutn.apps.googleusercontent.com",
                        clientSecret: "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"
                    }]
                }
            }, {
                config: {
                    thirdPartyId: "github",
                    clients: [{
                        clientId: "467101b197249757c71f",
                        clientSecret: "e97051221f4b6426e8fe8d51486396703012f5bd"
                    }]
                }
            }, {
                config: {
                    thirdPartyId: "apple",
                    clients: [{
                        clientId: "4398792-io.supertokens.example.service",
                        additionalConfig: {
                            keyId: "7M48Y4RYDL",
                            privateKey:
                                "-----BEGIN PRIVATE KEY-----\nMIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgu8gXs+XYkqXD6Ala9Sf/iJXzhbwcoG5dMh1OonpdJUmgCgYIKoZIzj0DAQehRANCAASfrvlFbFCYqn3I2zeknYXLwtH30JuOKestDbSfZYxZNMqhF/OzdZFTV0zc5u5s3eN+oCWbnvl0hM+9IW0UlkdA\n-----END PRIVATE KEY-----",
                            teamId: "YWQCXGJRJL",
                        }
                    }]
                }
            }],
        }),
        // if email verification is enabled..
        EmailVerification.init({
            emailDelivery: {
                service: new EmailVerificationSMTPService({ smtpSettings })
            },
            mode: "REQUIRED"
        }),
        Session.init(), // initializes session features
        Dashboard.init()
I think these are the recipes
c
went with this: Worked perfectly. Ty again!
Tho i do have another issue
my verification link that's generated gives me a 404 with nginx?
and the link also doesnt use
api.website.com/auth/verify-email
but rather
website.com/auth/verify-email
for
api.website.com/auth
i set the back end to listen on port 80 while setting a proxy pass for the back end's port of 3001 in nginx
should I also set a listener on port 80 for
website.com/auth
while setting the proxy pass for the back end's port of 3001 as well?
my app info looks like this
Copy code
ts
    appInfo: {
        // learn more about this on https://supertokens.com/docs/session/appinfo
        appName: "App name",
        apiDomain: "https://api.website.com",
        websiteDomain: "https://website.com",
        apiBasePath: "/auth",
        websiteBasePath: "/auth"
    },
r
not sure about your proxy setting here. Sorry
c
all g
is
website.com/auth/verify-email
already setup or would I have to set it up myself?
r
on the pre built Ui it's already setup as long as you send the react js bundle on that path from your server
ideally you should serve your react app on /auth/*
c
gotcha, what about if its a mobile app?
r
well in that case, the UI is within the mobile app so there is no /auth/* route on the frontend for that
10 Views