mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Fix OAuthDialog 'code' parse url
.. the code to parse the redirect url and exract the query item 'code' was fragile -- and got broken when Strava added a new query item to the returned URL. .. we now use QUrlQuery to extract in a more robust and future proof way Fixes #2879
This commit is contained in:
@@ -242,10 +242,8 @@ OAuthDialog::urlChanged(const QUrl &url)
|
||||
url.toString().contains("blank.html?code=") ||
|
||||
url.toString().startsWith("http://www.goldencheetah.org/?code=")) {
|
||||
|
||||
QString code = url.toString().right(url.toString().length()-url.toString().indexOf("code=")-5);
|
||||
|
||||
// sporttracks insists on passing state
|
||||
if (code.endsWith("&state=xyzzy")) code = code.mid(0,code.length()-12);
|
||||
QUrlQuery parse(url);
|
||||
QString code=parse.queryItemValue("code");
|
||||
|
||||
QByteArray data;
|
||||
#if QT_VERSION > 0x050000
|
||||
|
||||
Reference in New Issue
Block a user