Merge pull request #216 from soulcramer/add_twitter_login

Fixed the "url must not contain a query string" error
This commit is contained in:
Eduard Urbach 2019-03-04 11:24:25 +09:00 committed by GitHub
commit cfca5b76fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@ import (
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"net/url"
"strings" "strings"
"github.com/aerogo/aero" "github.com/aerogo/aero"
@ -79,7 +80,8 @@ func InstallTwitterAuth(app *aero.Application) {
} }
// Fetch user data from Twitter // Fetch user data from Twitter
resp, err := config.Get(nil, tokenCred, "https://api.twitter.com/1.1/account/verify_credentials.json?include_email=true&skip_status=true", nil) params := url.Values{"include_email": {"true"}, "skip_status": {"true"}}
resp, err := config.Get(nil, tokenCred, "https://api.twitter.com/1.1/account/verify_credentials.json", params)
if err != nil { if err != nil {
return ctx.Error(http.StatusBadRequest, "Failed requesting user data from Twitter", err) return ctx.Error(http.StatusBadRequest, "Failed requesting user data from Twitter", err)