1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-21 10:43:35 +00:00

feat(auth): [PM-8978] migrate SSO connector to Tailwind

- Convert Bootstrap styles to Tailwind
- Remove deprecated sso.scss
- Add test coverage for SSO connector

[PM-8978]
This commit is contained in:
Alec Rippberger
2025-04-28 10:14:29 -05:00
committed by GitHub
parent dff58de619
commit c2c31e54c1
5 changed files with 132 additions and 20 deletions

View File

@@ -2,10 +2,6 @@
// @ts-strict-ignore
import { getQsParam } from "./common";
// FIXME: Remove when updating file. Eslint update
// eslint-disable-next-line @typescript-eslint/no-require-imports
require("./sso.scss");
window.addEventListener("load", () => {
const code = getQsParam("code");
const state = getQsParam("state");
@@ -20,7 +16,7 @@ window.addEventListener("load", () => {
}
});
function initiateWebAppSso(code: string, state: string) {
export function initiateWebAppSso(code: string, state: string) {
// If we've initiated SSO from somewhere other than the SSO component on the web app, the SSO component will add
// a _returnUri to the state variable. Here we're extracting that URI and sending the user there instead of to the SSO component.
const returnUri = extractFromRegex(state, "(?<=_returnUri=')(.*)(?=')");
@@ -31,7 +27,7 @@ function initiateWebAppSso(code: string, state: string) {
}
}
function initiateBrowserSso(code: string, state: string, lastpass: boolean) {
export function initiateBrowserSso(code: string, state: string, lastpass: boolean) {
window.postMessage({ command: "authResult", code, state, lastpass }, window.location.origin);
const handOffMessage = ("; " + document.cookie)
.split("; ssoHandOffMessage=")