mirror of
https://github.com/bitwarden/web
synced 2025-12-27 21:53:29 +00:00
* support for sso * resetMasterPassword * update jslib * [Enterprise] Added button to launch portal (#570) * initial commit * Added Enterprise button and used new business portal bool * Reverting services module local changes * Formatted some new lines * Closed alerts on lock (#572) Co-authored-by: Addison Beck <addisonbeck@MacBook-Pro.local> * Updated enterprise URL dev (port) (#574) Co-authored-by: Vincent Salucci <26154748+vincentsalucci@users.noreply.github.com> Co-authored-by: Addison Beck <addisonbeck1@gmail.com> Co-authored-by: Addison Beck <addisonbeck@MacBook-Pro.local>
25 lines
674 B
TypeScript
25 lines
674 B
TypeScript
// tslint:disable-next-line
|
|
require('./sso.scss');
|
|
|
|
document.addEventListener('DOMContentLoaded', (event) => {
|
|
const code = getQsParam('code');
|
|
const state = getQsParam('state');
|
|
window.location.href = window.location.origin + '/#/sso?code=' + code + '&state=' + state;
|
|
});
|
|
|
|
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, ' '));
|
|
}
|