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

Fix panic when Hostname is used #70

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions oauth_device.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ func (oa *Flow) DeviceFlow() (*api.AccessToken, error) {

host := oa.Host
if host == nil {
host, err := NewGitHubHost("https://" + oa.Hostname)
parsedHost, err := NewGitHubHost("https://" + oa.Hostname)
if err != nil {
return nil, fmt.Errorf("error parsing the hostname '%s': %w", host, err)
return nil, fmt.Errorf("error parsing the hostname '%s': %w", oa.Hostname, err)
}
oa.Host = host
host = parsedHost
williammartin marked this conversation as resolved.
Show resolved Hide resolved
}

code, err := device.RequestCode(httpClient, host.DeviceCodeURL, oa.ClientID, oa.Scopes)
Expand Down
6 changes: 3 additions & 3 deletions oauth_webapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ func (oa *Flow) WebAppFlow() (*api.AccessToken, error) {
host := oa.Host

if host == nil {
host, err := NewGitHubHost("https://" + oa.Hostname)
parsedHost, err := NewGitHubHost("https://" + oa.Hostname)
if err != nil {
return nil, fmt.Errorf("error parsing the hostname '%s': %w", host, err)
return nil, fmt.Errorf("error parsing the hostname '%s': %w", oa.Hostname, err)
}
oa.Host = host
host = parsedHost
}

flow, err := webapp.InitFlow()
Expand Down
Loading