WIP: dirty fix to SSO web vs browser redirect logic split (#719)

* WIP: dirty fix to SSO web vs browser redirect logic split

* Use includes for clientId identification

routing determination more robust to future state string changes

Co-authored-by: Addison Beck <abeck@bitwarden.com>

Co-authored-by: Matt Gibson <mdgibson@Matts-MBP.lan>
Co-authored-by: Addison Beck <abeck@bitwarden.com>
This commit is contained in:
Matt Gibson 2020-11-24 11:29:04 -06:00 committed by GitHub
parent 0356ecc17b
commit 4625b44703
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -5,7 +5,7 @@ document.addEventListener('DOMContentLoaded', (event) => {
const code = getQsParam('code');
const state = getQsParam('state');
if (state != null && state.endsWith(':clientId=browser')) {
if (state != null && state.includes(':clientId=browser')) {
initiateBrowserSso(code, state);
} else {
window.location.href = window.location.origin + '/#/sso?code=' + code + '&state=' + state;