When overriding SMS Delivery, Am I missing something here? I'm using passwordless for MFA, and it tr...
b
When overriding SMS Delivery, Am I missing something here? I'm using passwordless for MFA, and it triggers an SMS to be sent. Now looking at using a custom method to handle the SMS send but when the code is triggered, it's not hitting my override? Is there something else I need to set up? Thanks in advance
r
Hey @bradvrm this seems about right. Is this using ts?
b
yeah, using TS. Just for some reason bypasses the override and sends via ST default service
r
Hmmm. That’s strange. It should be calling this function
Let me check
Which version of the node SDK?
b
13.0.2
r
i did this:
Copy code
ts
Passwordless.init({
            contactMethod: "EMAIL_OR_PHONE",
            flowType: "USER_INPUT_CODE_AND_MAGIC_LINK",
            smsDelivery: {
                override: (oI) => {
                    return {
                        ...oI,
                        sendSms: async (input) => {
                            console.log(input);
                        },
                    }
                }
            }
        }),
And it works for me
whats the contactMethod that you set?
b
yep same, email_or_phone and then same flow type
r
right. And are you calling the API? Or manually calling the passwordless.sendSms function? Have you compiled TS / restarted the server / purged cache?
b
calling the API to sign in, which then triggers the MFA code to be sent
r
can you enabled backend debug logging and show me the output when the API call is made to send the MFA code?
b
🤦‍♂️ ran an npm build and it's now picking up on it and working fine. Sorry!
r
ok great!
5 Views