I am trying to implement a project in Vuejs with this https://www.twilio.com/code-exchange/one-time-passcode-verification-otp. I deployed my functions through this.
I have a custom vuejs app that I’m using this in a form with.
Here is my front end function
verifyNumber() {
var auMobilePrefix = “+61”;
var m = this;
m.mobileNumber = ‘’;
m.mobileNumber = auMobilePrefix.concat(this.finalModel.mobile);
// console.log(m.mobileNumber);
const code = this.vcode;
const data = new URLSearchParams();
data.append(“to”, m.mobileNumber);
data.append(“verification_code”, code);
fetch(“https://verify-xxxx-xxxxx.twil.io/check-verify”, {
method: ‘POST’,
body: data
})
.then(response => response.json())
.then(json => {
if (json.success) {
console.log(json.message);
} else {
console.log(json.message);
}
})
.catch(err => {
console.log(err);
});
}
After I validate the code. I get the following error in console:
Verify-xxxx-xxxxx.twil.io/check-verify:1 Failed to load resource: the server responded with a status of 404 ()
MultiStepVerification.vue?280d:214 The requested resource /Services/VAxxxxxxx/VerificationCheck was not found
How do I resolve this issue?
Update
https://www.twilio.com/docs/verify/api/verification-check
This is actually the intended behaviour.
Twilio deletes the verification SID once it’s:
- expired
- approved
- when the max attempts to check a code have been reached
Under the verification service logs I noticed that the Status for my tests were Approved.