Hello, I am attempting to set up passwordless email and phone login using SuperTokens. I have config...
m
Hello, I am attempting to set up passwordless email and phone login using SuperTokens. I have configured a custom SMTP configuration, but unfortunately, it seems that my custom SMTP settings are not functioning correctly. Instead, the system appears to bypass them and sends emails and phone verification messages using the default method of SuperTokens.
here is the code for referance
Copy code
import ThirdPartyPasswordless from "supertokens-node/recipe/thirdpartypasswordless";
import Session from "supertokens-node/recipe/session";
import { TypeInput } from "supertokens-node/types";
import Dashboard from "supertokens-node/recipe/dashboard";
import UserRoles from "supertokens-node/recipe/userroles";
import EmailVerification from "supertokens-node/recipe/emailverification";
import { SMTPService as EmailVerificationSMTPService } from "supertokens-node/recipe/emailverification/emaildelivery";

export const SuperTokensConfig: TypeInput = {
  supertokens: {
    // this is the location of the SuperTokens core.
    connectionURI: "https://sso.custom.io",
    apiKey:
      "my-api-key",
  },
  appInfo: {
    appName: "SuperTokens Demo App",
    apiDomain: 'http://localhost:3001',
    websiteDomain: 'http://localhost:3000',
  },
  // recipeList contains all the modules that you want to
  // use from SuperTokens. See the full list here: https://supertokens.com/docs/guides
  recipeList: [
    ThirdPartyPasswordless.init({
      contactMethod: "EMAIL_OR_PHONE",
      flowType: "USER_INPUT_CODE_AND_MAGIC_LINK",
    }),
    EmailVerification.init({
      mode: "REQUIRED",
      emailDelivery: {
        service: new EmailVerificationSMTPService({
          smtpSettings: {
            host: "mysmtphost",
            authUsername: "awsUserName", // this is optional. In case not given, from.email will be used
            password: "aswPassKey",
            port: 587,
            from: {
            name: "Custom Social",
            email: "custom@custom.io",
            },
            secure: true,
          },
        }),
      },
    }),
    Session.init(),
    Dashboard.init(),
    UserRoles.init(),
  ],
};
r
are you talking about passwordless otp emails / sms?
Cause thats a config that goes in ThirdPartyPasswordless init not emailverification init
m
@rp_st Ohh! can you please provide me documentation link ?
And the next section has sms delivery too
4 Views