Skip to content

Commit 5bd6b2c

Browse files
committed
clearer error if endpoint missing DeviceAuthURL
1 parent e3fb0fb commit 5bd6b2c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

deviceauth.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ func (c *Config) DeviceAuth(ctx context.Context, opts ...AuthCodeOption) (*Devic
8888
}
8989

9090
func retrieveDeviceAuth(ctx context.Context, c *Config, v url.Values) (*DeviceAuthResponse, error) {
91+
if c.Endpoint.DeviceAuthURL == "" {
92+
return nil, fmt.Errorf("endpoint missing DeviceAuthURL")
93+
}
94+
9195
req, err := http.NewRequest("POST", c.Endpoint.DeviceAuthURL, strings.NewReader(v.Encode()))
9296
if err != nil {
9397
return nil, err

0 commit comments

Comments
 (0)