Add query for verification requests

Resolves #28
This commit is contained in:
Lakhan Samani
2021-07-18 09:52:54 +05:30
parent c6cbcd2e66
commit e2fc610762
14 changed files with 187 additions and 18 deletions

View File

@@ -34,9 +34,7 @@ func Login(ctx context.Context, params model.LoginInput) (*model.LoginResponse,
if user.EmailVerifiedAt <= 0 {
return res, fmt.Errorf(`email not verified`)
}
// match password
cost, err := bcrypt.Cost([]byte(user.Password))
log.Println(cost, err)
err = bcrypt.CompareHashAndPassword([]byte(user.Password), []byte(params.Password))
if err != nil {
@@ -68,6 +66,8 @@ func Login(ctx context.Context, params model.LoginInput) (*model.LoginResponse,
LastName: &user.LastName,
SignupMethod: user.SignupMethod,
EmailVerifiedAt: &user.EmailVerifiedAt,
CreatedAt: &user.CreatedAt,
UpdatedAt: &user.UpdatedAt,
},
}