Skip to content

Commit

Permalink
add check for auth token size
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduard-Voiculescu committed Sep 11, 2024
1 parent 291f85f commit 9659116
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tui2/pages/request/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,11 @@ func (r *Request) renderRequestSummary() string {
packageName = fmt.Sprintf("%s (%s-%s)", packageName, packageMetaName, packageMetaVersion)
jwt := "JWT token not set, run `substreams auth` to set it"
if r.Config.SubstreamsClientConfig.AuthToken() != "" {
jwt = fmt.Sprintf("%s...", r.Config.SubstreamsClientConfig.AuthToken()[0:50]) // display only the first 50 characters
if len(r.Config.SubstreamsClientConfig.AuthToken()) < 50 {
jwt = r.Config.SubstreamsClientConfig.AuthToken()
} else {
jwt = fmt.Sprintf("%s...", r.Config.SubstreamsClientConfig.AuthToken()[0:50]) // display only the first 50 characters
}
}
rows := [][]string{
{"Package:", packageName},
Expand Down

0 comments on commit 9659116

Please sign in to comment.