diff --git a/dev-helpers/oauth2-redirect.html b/dev-helpers/oauth2-redirect.html index 00c7f014..a7eb162d 100644 --- a/dev-helpers/oauth2-redirect.html +++ b/dev-helpers/oauth2-redirect.html @@ -11,7 +11,11 @@ var redirectUrl = oauth2.redirectUrl; var isValid, qp, arr; - qp = (window.location.hash || location.search).substring(1); + if (/code|token|error/.test(window.location.hash)) { + qp = window.location.hash.substring(1); + } else { + qp = location.search.substring(1); + } arr = qp.split("&") arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';}) diff --git a/dist/oauth2-redirect.html b/dist/oauth2-redirect.html index 00c7f014..a7eb162d 100644 --- a/dist/oauth2-redirect.html +++ b/dist/oauth2-redirect.html @@ -11,7 +11,11 @@ var redirectUrl = oauth2.redirectUrl; var isValid, qp, arr; - qp = (window.location.hash || location.search).substring(1); + if (/code|token|error/.test(window.location.hash)) { + qp = window.location.hash.substring(1); + } else { + qp = location.search.substring(1); + } arr = qp.split("&") arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';})