Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mschilli87 opened this issue Nov 28, 2024 · 0 comments
Open

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

mschilli87 opened this issue Nov 28, 2024 · 0 comments

Comments

@mschilli87
Copy link

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant