// RequestCode initiates the authorization flow by requesting a code.
RequestCode initiates the authorization flow by requesting a code.
// RequestCode initiates the authorization flow by requesting a code .
func (c Config) RequestCode(ctx context.Context) (*DeviceCode, *atlas.Response, error) {
	req, err := c.NewRequest(ctx, http.MethodPost, deviceBasePath+"/authorize",
		url.Values{
			"client_id": {c.ClientID},
			"scope":     {strings.Join(c.Scopes, " ")},
		},
	)
	if err != nil {
		return nil, nil, err
	}
	var r *DeviceCode
	resp, err2 := c.Do(ctx, req, &r)
	return r, resp, err2
}
func ( c Config ) RequestCode ( ctx context . Context ) ( * DeviceCode , * atlas . Response , error ) { req , err := c . NewRequest ( ctx , http . MethodPost , deviceBasePath + " " , url . Values { " " : { c . ClientID } , " " : { strings . Join ( c . Scopes , " " ) } , } , ) if err != nil { return nil , nil , err } var r * DeviceCode resp , err2 := c . Do ( ctx , req , & r ) return r , resp , err2 }
RequestCode initiates the authorization flow by requesting a code.
RequestCode initiates the authorization flow by requesting a code .