supertokens / supertokens-golang

GoLang SDK for SuperTokens
https://supertokens.com
Other
112 stars 32 forks source link

Supertoken UserInput (Passwordless Authentication) #365

Closed jimcru21 closed 11 months ago

jimcru21 commented 11 months ago

Im using other SMS Otp Provider

After overriding the default smsdelivery, the input.PasswordlessLogin.UserInputCode giver random hex decimal code ( ex: 0x14000546150 ) instead of 6 digit code.

nkshah2 commented 11 months ago

Hi @jimcru21

Can you post the code you are using?

rishabhpoddar commented 11 months ago

Are you generating your own OTPs as well?

jimcru21 commented 11 months ago

Are you generating your own OTPs as well?

No. Im just customize the SMS. I Dont want to use built in and twillio

jimcru21 commented 11 months ago

Hi @jimcru21

Can you post the code you are using?

This some Code snippet

*originalImplementation.SendSms = func(input smsdelivery.SmsType, userContext supertokens.UserContext) error {
        // amount of time the code is alive for (in MS)
        codeLifetime := input.PasswordlessLogin.CodeLifetime
        phoneNumber := input.PasswordlessLogin.PhoneNumber

        // OTP
        userInputCode := input.PasswordlessLogin.UserInputCode
        fmt.Println(codeLifetime)
        fmt.Println(phoneNumber)
        fmt.Println(userInputCode, "user Code")

        // TODO: Create And Send OTP

        return nil

    }
nkshah2 commented 11 months ago

Hi @jimcru21 input.PasswordlessLogin.UserInputCode is a pointer. To get the string value of it you should use *input.PasswordlessLogin.UserInputCode

Closing this issue for now, feel free to re-open it if the issue persists