diff --git a/oauth_device.go b/oauth_device.go index 3e39877..aef280f 100644 --- a/oauth_device.go +++ b/oauth_device.go @@ -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 } code, err := device.RequestCode(httpClient, host.DeviceCodeURL, oa.ClientID, oa.Scopes) diff --git a/oauth_webapp.go b/oauth_webapp.go index 22a77aa..9c7af15 100644 --- a/oauth_webapp.go +++ b/oauth_webapp.go @@ -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()