mirror of
https://github.com/bitwarden/browser
synced 2025-12-21 18:53:29 +00:00
WebAuthn (#633)
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
// tslint:disable-next-line
|
||||
import { getQsParam } from './common';
|
||||
|
||||
// tslint:disable-next-line
|
||||
require('./sso.scss');
|
||||
|
||||
document.addEventListener('DOMContentLoaded', event => {
|
||||
@@ -19,22 +21,6 @@ document.addEventListener('DOMContentLoaded', event => {
|
||||
}
|
||||
});
|
||||
|
||||
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, ' '));
|
||||
}
|
||||
|
||||
function initiateBrowserSso(code: string, state: string) {
|
||||
window.postMessage({ command: 'authResult', code: code, state: state }, '*');
|
||||
const handOffMessage = ('; ' + document.cookie).split('; ssoHandOffMessage=').pop().split(';').shift();
|
||||
|
||||
Reference in New Issue
Block a user