func (p *Provider) FetchUser(session goth.Session) (goth.User, error) {
	s := session.(*Session)
	u := goth.User{
		Provider:    p.Name(),
		AccessToken: s.ResponseNonce,
	}

	if s.SteamID == "" {
		// data is not yet retrieved since SteamID is still empty
		return u, fmt.Errorf("%s cannot get user information without SteamID", p.providerName)
	}

	apiURL := fmt.Sprintf(apiUserSummaryEndpoint, p.APIKey, s.SteamID)
	req, err := http.NewRequest("GET", apiURL, nil)
	if err != nil {
		return u, err
	}
	req.Header.Add("Accept", "application/json")
	resp, err := p.Client().Do(req)
	if err != nil {
		if resp != nil {
			resp.Body.Close()
		}
		return u, err
	}
	defer resp.Body.Close()

	if resp.StatusCode != http.StatusOK {
		return u, fmt.Errorf("%s responded with a %d trying to fetch user information", p.providerName, resp.StatusCode)
	}

	u, err = buildUserObject(resp.Body, u)

	return u, err
}
// FetchUser will go to Steam and access basic info about the user.
FetchUser will go to Steam and access basic info about the user.
// FetchUser will go to Steam and access basic info about the user .
func (p *Provider) FetchUser(session goth.Session) (goth.User, error) {
	s := session.(*Session)
	u := goth.User{
		Provider:    p.Name(),
		AccessToken: s.ResponseNonce,
	}
	if s.SteamID == "" {
		return u, fmt.Errorf("%s cannot get user information without SteamID", p.providerName)
	}
	apiURL := fmt.Sprintf(apiUserSummaryEndpoint, p.APIKey, s.SteamID)
	req, err := http.NewRequest("GET", apiURL, nil)
	if err != nil {
		return u, err
	}
	req.Header.Add("Accept", "application/json")
	resp, err := p.Client().Do(req)
	if err != nil {
		if resp != nil {
			resp.Body.Close()
		}
		return u, err
	}
	defer resp.Body.Close()
	if resp.StatusCode != http.StatusOK {
		return u, fmt.Errorf("%s responded with a %d trying to fetch user information", p.providerName, resp.StatusCode)
	}
	u, err = buildUserObject(resp.Body, u)
	return u, err
}
func ( p * Provider ) FetchUser ( session goth . Session ) ( goth . User , error ) { s := session . ( * Session ) u := goth . User { Provider : p . Name ( ) , AccessToken : s . ResponseNonce , } if s . SteamID == " " { return u , fmt . Errorf ( " " , p . providerName ) } apiURL := fmt . Sprintf ( apiUserSummaryEndpoint , p . APIKey , s . SteamID ) req , err := http . NewRequest ( " " , apiURL , nil ) if err != nil { return u , err } req . Header . Add ( " " , " " ) resp , err := p . Client ( ) . Do ( req ) if err != nil { if resp != nil { resp . Body . Close ( ) } return u , err } defer resp . Body . Close ( ) if resp . StatusCode != http . StatusOK { return u , fmt . Errorf ( " " , p . providerName , resp . StatusCode ) } u , err = buildUserObject ( resp . Body , u ) return u , err }
FetchUser will go to Steam and access basic info about the user.
FetchUser will go to Steam and access basic info about the user .
// data is not yet retrieved since SteamID is still empty