Skip to content

Commit 947953d

Browse files
committed
fix #3624
1 parent de64123 commit 947953d

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

dev-helpers/oauth2-redirect.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
var redirectUrl = oauth2.redirectUrl;
1212
var isValid, qp, arr;
1313

14-
qp = (window.location.hash || location.search).substring(1);
14+
if (/code|token|error/.test(window.location.hash)) {
15+
qp = window.location.hash.substring(1);
16+
} else {
17+
qp = location.search.substring(1);
18+
}
1519

1620
arr = qp.split("&")
1721
arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';})

dist/oauth2-redirect.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
var redirectUrl = oauth2.redirectUrl;
1212
var isValid, qp, arr;
1313

14-
qp = (window.location.hash || location.search).substring(1);
14+
if (/code|token|error/.test(window.location.hash)) {
15+
qp = window.location.hash.substring(1);
16+
} else {
17+
qp = location.search.substring(1);
18+
}
1519

1620
arr = qp.split("&")
1721
arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';})

0 commit comments

Comments
 (0)