mirror of
				https://git.coolaj86.com/coolaj86/browser-authenticator.js
				synced 2025-11-04 02:12:46 +00:00 
			
		
		
		
	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:
		
							parent
							
								
									407521782c
								
							
						
					
					
						commit
						50bdd31ecd
					
				@ -60,7 +60,10 @@
 | 
				
			|||||||
    var accountName;
 | 
					    var accountName;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    otplink.href = otpauth;
 | 
					    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(':');
 | 
					    meta = otplink.pathname.replace(/.*\/totp\//, '').split(':');
 | 
				
			||||||
    // TODO throw if otp.issuer !== decodeURI(meta[0])
 | 
					    // TODO throw if otp.issuer !== decodeURI(meta[0])
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user