Merge pull request #44 from lanodan/bugfix/authcode-parsing

qml/pages/LoginPage.qml: Fix URL parsing to get the Authentification code
This commit is contained in:
Dusko Angirevic 2019-02-16 18:35:04 +01:00 committed by GitHub
commit d67a4c224e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -144,7 +144,12 @@ Page {
(url+"").substr(0, 38) === 'https://localhost/harbour-tooter?code='
) {
visible = false;
var authCode = (url+"").substr(-64)
var vars = {};
(url+"").replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) { vars[key] = value;}); /* found on https://html-online.com/articles/get-url-parameters-javascript/ */
var authCode = vars["code"];
console.log(authCode)
Logic.api.getAccessTokenFromAuthCode(