Skip to content

Commit bbf169b

Browse files
committed
workaround verification_url
1 parent 2d9e4a2 commit bbf169b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

deviceauth.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ func (c *DeviceAuthResponse) UnmarshalJSON(data []byte) error {
5858
type Alias DeviceAuthResponse
5959
aux := &struct {
6060
ExpiresIn int64 `json:"expires_in"`
61+
// workaround misspelling of verification_uri
62+
VerificationURL string `json:"verification_url"`
6163
*Alias
6264
}{
6365
Alias: (*Alias)(c),
@@ -68,6 +70,9 @@ func (c *DeviceAuthResponse) UnmarshalJSON(data []byte) error {
6870
if aux.ExpiresIn != 0 {
6971
c.Expiry = time.Now().UTC().Add(time.Second * time.Duration(aux.ExpiresIn))
7072
}
73+
if c.VerificationURI == "" {
74+
c.VerificationURI = aux.VerificationURL
75+
}
7176
return nil
7277
}
7378

0 commit comments

Comments
 (0)