Skip to content

Commit 3221740

Browse files
committed
Fix issue with reset password
1 parent 1e759c6 commit 3221740

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

server/resolvers/reset_password.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"fmt"
66
"strings"
7+
"time"
78

89
"github.com/authorizerdev/authorizer/server/constants"
910
"github.com/authorizerdev/authorizer/server/db"
@@ -47,6 +48,12 @@ func ResetPassword(ctx context.Context, params model.ResetPasswordInput) (*model
4748
}
4849
user.SignupMethods = signupMethod
4950

51+
// helpful if user has not signed up with basic auth
52+
if user.EmailVerifiedAt == nil {
53+
now := time.Now().Unix()
54+
user.EmailVerifiedAt = &now
55+
}
56+
5057
// delete from verification table
5158
db.Mgr.DeleteVerificationRequest(verificationRequest)
5259
db.Mgr.UpdateUser(user)

0 commit comments

Comments
 (0)