Fix "Do not work in Firefox" bug

For firefox, optlink.search return empty string.
Create a function to extract query string and pass to parseQuery function.
This commit is contained in:
Connie 2017-02-15 07:27:30 -07:00 committed by tigerbot
parent 407521782c
commit 50bdd31ecd
1 changed files with 4 additions and 1 deletions

View File

@ -60,7 +60,10 @@
var accountName;
otplink.href = otpauth;
otp = parseQuery(otplink.search);
var idx = otplink.href.indexOf('?');
var queryString = (idx >= 0 ? otplink.href.slice(idx) : '');
otp = parseQuery(queryString);
meta = otplink.pathname.replace(/.*\/totp\//, '').split(':');
// TODO throw if otp.issuer !== decodeURI(meta[0])