Merge branch 'main' into feat/dashboard

This commit is contained in:
Lakhan Samani
2022-01-09 15:04:08 +05:30
2 changed files with 82 additions and 75 deletions

View File

@@ -4,6 +4,7 @@ import (
"context"
"fmt"
"strings"
"time"
"github.com/authorizerdev/authorizer/server/constants"
"github.com/authorizerdev/authorizer/server/db"
@@ -47,6 +48,12 @@ func ResetPassword(ctx context.Context, params model.ResetPasswordInput) (*model
}
user.SignupMethods = signupMethod
// helpful if user has not signed up with basic auth
if user.EmailVerifiedAt == nil {
now := time.Now().Unix()
user.EmailVerifiedAt = &now
}
// delete from verification table
db.Mgr.DeleteVerificationRequest(verificationRequest)
db.Mgr.UpdateUser(user)