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:
commit
d67a4c224e
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