Fix issue with reset password
This commit is contained in:
parent
1e759c64ed
commit
3221740198
|
@ -4,6 +4,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/authorizerdev/authorizer/server/constants"
|
"github.com/authorizerdev/authorizer/server/constants"
|
||||||
"github.com/authorizerdev/authorizer/server/db"
|
"github.com/authorizerdev/authorizer/server/db"
|
||||||
|
@ -47,6 +48,12 @@ func ResetPassword(ctx context.Context, params model.ResetPasswordInput) (*model
|
||||||
}
|
}
|
||||||
user.SignupMethods = signupMethod
|
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
|
// delete from verification table
|
||||||
db.Mgr.DeleteVerificationRequest(verificationRequest)
|
db.Mgr.DeleteVerificationRequest(verificationRequest)
|
||||||
db.Mgr.UpdateUser(user)
|
db.Mgr.UpdateUser(user)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user