Skip to content

fix: set context to avoid panic on token refresh#86

Merged
gianarb merged 1 commit into
mainfrom
fix/resolve-panic-on-token-refresh
Jan 22, 2026
Merged

fix: set context to avoid panic on token refresh#86
gianarb merged 1 commit into
mainfrom
fix/resolve-panic-on-token-refresh

Conversation

@scotwells

Copy link
Copy Markdown
Contributor

When a user's access token was expired, the CLI would try to refresh the access token but it would encounter a panic because the context was nil.

This resolves the issue by passing the context through to the factory so it can be used when refreshing the access token.

panic: nil context

goroutine 1 [running]:
net/http.(*Request).WithContext(...)
        /opt/hostedtoolcache/go/1.25.6/x64/src/net/http/request.go:370
...

I confirmed after updating this code, that I could invoke the command successfully again and it would get a new access token.


Follow up to #65

When a user's access token was expired, the CLI would try to refresh the
access token but it would encounter a panic because the context was
`nil`.

This resolves the issue by passing the context through to the factory so
it can be used when refreshing the access token.
@scotwells
scotwells requested a review from gianarb January 22, 2026 17:33

@gianarb gianarb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@gianarb
gianarb merged commit 710ca4f into main Jan 22, 2026
1 check passed
@gianarb
gianarb deleted the fix/resolve-panic-on-token-refresh branch January 22, 2026 20:14
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

Successfully merging this pull request may close these issues.

2 participants