Changed token creation to URL - Encoded #2
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For some reason, when trying to create a new token it resulted in an error:
goroutine 1 [running]:
log.Panic({0x1400014fcf0?, 0x0?, 0x0?})
/home/migue/.asdf/installs/golang/1.20.5/go/src/log/log.go:384 +0x64
github.com/Madh93/toffu/cmd.glob..func5(0x1013e7c80?, {0x10100d264?, 0x0?, 0x0?})
/home/migue/Workspace/repos/toffu/cmd/token.go:17 +0x5c
github.com/spf13/cobra.(*Command).execute(0x1013e7c80, {0x1014257e8, 0x0, 0x0})
/home/migue/.go/pkg/mod/github.com/spf13/[email protected]/command.go:944 +0x5b0
github.com/spf13/cobra.(*Command).ExecuteC(0x1013e76c0)
/home/migue/.go/pkg/mod/github.com/spf13/[email protected]/command.go:1068 +0x35c
github.com/spf13/cobra.(*Command).Execute(...)
/home/migue/.go/pkg/mod/github.com/spf13/[email protected]/command.go:992
github.com/Madh93/toffu/cmd.Execute(...)
/home/migue/Workspace/repos/toffu/cmd/root.go:31
main.main()
/home/migue/Workspace/repos/toffu/main.go:11 +0x40
And when digging into it, it was a result of the petition always getting status code 403: Forbidden.
For some reason, simply changing content type from application/json to url-encoded fixed the problem.