func ValidateAuth(ctx context.Context, username string, client *Client) error {
	// This does a final request to validate that auth was successful. Cookies
	// may be filtered by a proxy, or a misconfigured client, so this check is
	// necessary.
	result := struct {
		Ctx struct {
			Name string `json:"name"`
		} `json:"userCtx"`
	}{}
	if _, err := client.DoJSON(ctx, "GET", "/_session", nil, &result); err != nil {
		return err
	}
	if result.Ctx.Name != username {
		return errors.New("authentication failed")
	}
	return nil
}
// ValidateAuth validates that the requested username is authenticated.
ValidateAuth validates that the requested username is authenticated.
// ValidateAuth validates that the requested username is authenticated .
func ValidateAuth(ctx context.Context, username string, client *Client) error {
	result := struct {
		Ctx struct {
			Name string `json:"name"`
		} `json:"userCtx"`
	}{}
	if _, err := client.DoJSON(ctx, "GET", "/_session", nil, &result); err != nil {
		return err
	}
	if result.Ctx.Name != username {
		return errors.New("authentication failed")
	}
	return nil
}
func ValidateAuth ( ctx context . Context , username string , client * Client ) error { result := struct { Ctx struct { Name string `json:"name"` } `json:"userCtx"` } { } if _ , err := client . DoJSON ( ctx , " " , " " , nil , & result ) ; err != nil { return err } if result . Ctx . Name != username { return errors . New ( " " ) } return nil }
ValidateAuth validates that the requested username is authenticated.
ValidateAuth validates that the requested username is authenticated .
// This does a final request to validate that auth was successful. Cookies // may be filtered by a proxy, or a misconfigured client, so this check is // necessary.