Hi, is there a way to setup a predefined test phon...
# support-questions-legacy
t
Hi, is there a way to setup a predefined test phone number and sms code for passwordless auth in supertokens-node? e.g for phone number 12345678 and code 123456 bypass sms auth and create session for a test user?
r
hey @tjayleno There is, but a simpler method would be to just provide a custom sendSms function which just console logs the OTP if in dev mode, else calls the original implementation.
t
but in this case we need it for end-to-end
r
If that doesn't work for you though, then you can make it so that just typing in "0000" as the OTP with that phone number works as well. To do this, you want to: - Define your own sendSms function which saves the input OTP against the preAuthSessionId (in a map in memory) - Override the consumeCode API which checks if the input preAuthSessionId exists in that map, and if the input OTP is 0000, then it fetches the real OTP from that map and calls the original implementation with it
This is kind of what we do for our end to end tetss
t
ahh that makes sense I will try it out ty!