Skip to content

Commit 06d5ad9

Browse files
author
Jayash Satolia
committed
Debug
1 parent d2b4c26 commit 06d5ad9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

code/go/0chain.net/blobbercore/handler/auth_ticket.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ package handler
33
import (
44
"context"
55
"fmt"
6+
"github.com/0chain/blobber/code/go/0chain.net/core/logging"
67
"github.com/0chain/blobber/code/go/0chain.net/core/node"
78
"github.com/0chain/common/core/common"
89
"github.com/0chain/gosdk/core/encryption"
10+
"go.uber.org/zap"
911
"net/http"
1012
)
1113

@@ -41,9 +43,14 @@ func GenerateAuthTicket(ctx context.Context, r *http.Request) (interface{}, erro
4143
}
4244

4345
round := r.URL.Query().Get("round")
46+
if round == "" {
47+
return nil, common.NewError("missing_round", "round is required")
48+
}
4449

4550
payload := encryption.Hash(fmt.Sprintf("%s_%s", clientID, round))
4651

52+
logging.Logger.Info("GenerateAuthTicket", zap.String("payload", payload), zap.String("client_id", clientID), zap.String("round", round))
53+
4754
signature, err := node.Self.Sign(payload)
4855
if err != nil {
4956
return nil, common.NewError("signature_failed", "signature failed")

0 commit comments

Comments
 (0)