qml/pages/LoginPage.qml: Fix URL parsing to get the Authentification code
This commit is contained in:
parent
44495cb34c
commit
7739c9952e
1 changed files with 6 additions and 1 deletions
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue