hello, [Pardon in advance if this has been asked ...
# support-questions-legacy
n
hello, [Pardon in advance if this has been asked earlier in some thread, haven't come across any] Context: we are using self hosted supertokens core, and golang sdk in the backend auth service presently the OTP flow is : 1. front-end client (the react single-page-app [spa]) request signs in/up by calling the auth backend service 2. auth backend communicates with supertokens core where the OTP is generated 3. OTP is communicated to the concerned phone number 4. the spa calls the OTP consume API with the generted OTP and according the sign in/up is handled Now, we need a way to bypass out QA testers , say in staging/dev/qa environment, for a fixed set of numbers, only a fixed OTP is generted. So, any suggestions for this?
n
Hi @nabeel4628, Just to make sure I understand correctly, you have the OTP flow built out but you want a specific set of phone numbers to be able to use a fixed OTP so that QA is easier correct?
n
right @nkshah2 (thanks for prompt response) we have OTP + social login (basically thirdpartypasswordless recipie) and yes we want a specific set of phone numbers to be able to use a fixed OTP so that QA is easier
s
hey
you could use an override like this:
Copy code
Override: &tplmodels.OverrideStruct{
                    Functions: func(originalImplementation tplmodels.RecipeInterface) tplmodels.RecipeInterface {
                        oCreateCode := *originalImplementation.CreateCode
                        nCreateCode := func(email *string, phoneNumber *string, userInputCode *string, userContext supertokens.UserContext) (plessmodels.CreateCodeResponse, error) {
                            if phoneNumber != nil {
                                if otp, ok := fixedOTPs[*phoneNumber]; ok {
                                    return oCreateCode(email, phoneNumber, &otp, userContext)
                                }
                            }
                            return oCreateCode(email, phoneNumber, userInputCode, userContext)
                        }
                        *originalImplementation.CreateCode = nCreateCode
                        return originalImplementation
                    },
                },
Copy code
var fixedOTPs = map[string]string{
    "9876543210": "000000",
}
n
thank you very much @sattvikc , will try this and let you know.
@sattvikc thanks, it works ! 🥳