mirror of
https://github.com/bitwarden/browser
synced 2025-12-20 02:03:39 +00:00
WebAuthn (#633)
This commit is contained in:
15
src/connectors/common.ts
Normal file
15
src/connectors/common.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
export function getQsParam(name: string) {
|
||||
const url = window.location.href;
|
||||
name = name.replace(/[\[\]]/g, '\\$&');
|
||||
const regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)');
|
||||
const results = regex.exec(url);
|
||||
|
||||
if (!results) {
|
||||
return null;
|
||||
}
|
||||
if (!results[2]) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return decodeURIComponent(results[2].replace(/\+/g, ' '));
|
||||
}
|
||||
Reference in New Issue
Block a user