Skip to content

Commit 13a8e35

Browse files
committed
Fix for GitHub
1 parent 4d789d2 commit 13a8e35

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

deviceauth.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ func retrieveDeviceAuth(ctx context.Context, c *Config, v url.Values) (*DeviceAu
3636
return nil, err
3737
}
3838
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
39+
req.Header.Set("Accept", "application/json")
3940

4041
r, err := ctxhttp.Do(ctx, nil, req)
4142
if err != nil {
@@ -56,7 +57,7 @@ func retrieveDeviceAuth(ctx context.Context, c *Config, v url.Values) (*DeviceAu
5657
da := &DeviceAuth{}
5758
err = json.Unmarshal(body, &da)
5859
if err != nil {
59-
return nil, err
60+
return nil, fmt.Errorf("unmarshal %s", err)
6061
}
6162

6263
_ = json.Unmarshal(body, &da.raw)

endpoints/endpoints.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ var Fitbit = oauth2.Endpoint{
5555

5656
// GitHub is the endpoint for Github.
5757
var GitHub = oauth2.Endpoint{
58-
AuthURL: "https://github.com/login/oauth/authorize",
59-
TokenURL: "https://github.com/login/oauth/access_token",
58+
AuthURL: "https://github.com/login/oauth/authorize",
59+
TokenURL: "https://github.com/login/oauth/access_token",
60+
DeviceAuthURL: "https://github.com/login/device/code",
6061
}
6162

6263
// GitLab is the endpoint for GitLab.

0 commit comments

Comments
 (0)