Skip to content

Commit

Permalink
clearer error if endpoint missing DeviceAuthURL
Browse files Browse the repository at this point in the history
  • Loading branch information
hickford committed Sep 7, 2023
1 parent e3fb0fb commit c6de29a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions deviceauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ func (c *DeviceAuthResponse) UnmarshalJSON(data []byte) error {
// DeviceAuth returns a device auth struct which contains a device code
// and authorization information provided for users to enter on another device.
func (c *Config) DeviceAuth(ctx context.Context, opts ...AuthCodeOption) (*DeviceAuthResponse, error) {
if c.Endpoint.DeviceAuthURL == "" {
return nil, fmt.Errorf("endpoint missing DeviceAuthURL")
}

// https://datatracker.ietf.org/doc/html/rfc8628#section-3.1
v := url.Values{
"client_id": {c.ClientID},
Expand Down

0 comments on commit c6de29a

Please sign in to comment.