Skip to content

panic: error creating Token [MacOS homebrew install) #3

Description

@mschilli87

I installed toffu on my Mac via

brew install madh93/tap/toffu

but running

toffu token

crashes:

Generating a new Woffu token...
Username: user@company.tld
Password: error creating Token
panic: error creating Token

goroutine 1 [running]:
log.Panic({0x1400017bcf0?, 0x0?, 0x0?})
	/home/migue/.asdf/installs/golang/1.20.5/go/src/log/log.go:384 +0x64
github.com/Madh93/toffu/cmd.glob..func5(0x100e0fc80?, {0x100a35264?, 0x0?, 0x0?})
	/home/migue/Workspace/repos/toffu/cmd/token.go:17 +0x5c
github.com/spf13/cobra.(*Command).execute(0x100e0fc80, {0x100e4d7e8, 0x0, 0x0})
	/home/migue/.go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:944 +0x5b0
github.com/spf13/cobra.(*Command).ExecuteC(0x100e0f6c0)
	/home/migue/.go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:1068 +0x35c
github.com/spf13/cobra.(*Command).Execute(...)
	/home/migue/.go/pkg/mod/github.com/spf13/cobra@v1.7.0/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

After manually requesting a token via (note the leading space to prevent credentials from ending up in shell command history!)

 curl -d 'grant_type=password&username=user@company.tld&password=<secret>' 'https://app.woffu.com/token'

and copy/pasting the token from the response to ~/.toffu/toffu.json:

{"woffu_token":"<token-from-response>"}
toffu status

appears to be working:

Status: Out of Office
Total hours worked today: 0h 0m 0s (Xh Ym Zs remaining)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions