qml/pages/LoginPage.qml: Fix URL parsing to get the Authentification code

This commit is contained in:
Haelwenn (lanodan) Monnier 2019-01-27 20:14:08 +01:00
parent 44495cb34c
commit 7739c9952e
No known key found for this signature in database
GPG key ID: D5B7A8E43C997DEE

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(