feat: add sending otp

This commit is contained in:
Lakhan Samani
2022-07-29 19:49:50 +05:30
parent 0fc9e8ccaa
commit d89be44fe5
15 changed files with 231 additions and 49 deletions

View File

@@ -52,8 +52,7 @@ func VerifyOtpResolver(ctx context.Context, params model.VerifyOTPRequest) (*mod
isSignUp := user.EmailVerifiedAt == nil
// TODO - Add Login method in DB
// TODO - Add Login method in DB when we introduce OTP for social media login
loginMethod := constants.AuthRecipeMethodBasicAuth
roles := strings.Split(user.Roles, ",")
@@ -65,11 +64,7 @@ func VerifyOtpResolver(ctx context.Context, params model.VerifyOTPRequest) (*mod
}
go func() {
err = db.Provider.DeleteOTP(gc, otp)
if err != nil {
log.Debug("Failed to delete otp: ", err)
}
db.Provider.DeleteOTP(gc, otp)
if isSignUp {
utils.RegisterEvent(ctx, constants.UserSignUpWebhookEvent, loginMethod, user)
} else {