Withings Authorization - Use https for callback URL

Fixes #4065
This commit is contained in:
Alejandro Martinez
2021-11-09 16:39:38 -03:00
parent 5a2e1cc3a8
commit 7ca84ecd3e
2 changed files with 4 additions and 3 deletions

View File

@@ -180,7 +180,7 @@ OAuthDialog::OAuthDialog(Context *context, OAuthSite site, CloudService *service
} else if (site == WITHINGS) {
urlstr = QString("https://account.withings.com/oauth2_user/authorize2?");
urlstr.append("redirect_uri=http://www.goldencheetah.org&");
urlstr.append("redirect_uri=https://www.goldencheetah.org&");
urlstr.append("scope=user.info,user.metrics&");
urlstr.append("response_type=code&");
urlstr.append("state=xyzzy&");
@@ -238,6 +238,7 @@ OAuthDialog::urlChanged(const QUrl &url)
if (url.toString().startsWith("http://www.goldencheetah.org/?state=&code=") ||
url.toString().contains("blank.html?code=") ||
url.toString().startsWith("https://www.goldencheetah.org/?code=") ||
url.toString().startsWith("http://www.goldencheetah.org/?code=")) {
QUrlQuery parse(url);
@@ -331,7 +332,7 @@ OAuthDialog::urlChanged(const QUrl &url)
urlstr = QString("https://account.withings.com/oauth2/token?");
params.addQueryItem("client_id", GC_NOKIA_CLIENT_ID);
params.addQueryItem("client_secret", GC_NOKIA_CLIENT_SECRET);
params.addQueryItem("redirect_uri","http://www.goldencheetah.org");
params.addQueryItem("redirect_uri","https://www.goldencheetah.org");
params.addQueryItem("grant_type", "authorization_code");
}

View File

@@ -258,7 +258,7 @@ macx {
# if you have your own MAPQUEST KEY
#DEFINES += GC_MAPQUESTAPI_KEY=\\\"xxxxxxxxxxxxxxxxxxxxxx\\\"
# USING THE WITHINGS API (http://oauth.withings.com/api, use http://www.goldencheetah.org as CALLBACK URL)
# USING THE WITHINGS API (http://oauth.withings.com/api, use https://www.goldencheetah.org as CALLBACK URL)
#DEFINES += GC_NOKIA_CLIENT_ID=\\\"xxxxxxxxxxxxxxx\\\"
#DEFINES += GC_NOKIA_CLIENT_SECRET=\\\"xxxxxxxxxxxxxxx\\\"