Skip to content

Commit

Permalink
lint: lint code
Browse files Browse the repository at this point in the history
  • Loading branch information
liaosunny123 committed Jul 29, 2023
1 parent b75af46 commit 4a415a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/services/auth/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,14 @@ func (a AuthServiceImpl) Login(ctx context.Context, request *auth.LoginRequest)
}

func hashPassword(ctx context.Context, password string) (string, error) {
span, ctx := opentracing.StartSpanFromContext(ctx, "Auth-PasswordHash")
span, _ := opentracing.StartSpanFromContext(ctx, "Auth-PasswordHash")
defer span.Finish()
bytes, err := bcrypt.GenerateFromPassword([]byte(password), 12)
return string(bytes), err
}

func checkPasswordHash(ctx context.Context, password, hash string) bool {
span, ctx := opentracing.StartSpanFromContext(ctx, "Auth-PasswordHashChecked")
span, _ := opentracing.StartSpanFromContext(ctx, "Auth-PasswordHashChecked")
defer span.Finish()
err := bcrypt.CompareHashAndPassword([]byte(hash), []byte(password))
return err == nil
Expand Down

0 comments on commit 4a415a2

Please sign in to comment.