1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 00:03:56 +00:00

PM-8111 - (1) Cleanup DefaultLoginComponentService (2) Sso Connector now checks client id property instead of reading it from state

This commit is contained in:
Jared Snider
2024-09-30 16:04:04 -04:00
parent 04fa618ea8
commit 8469e3541a
2 changed files with 6 additions and 13 deletions

View File

@@ -48,11 +48,7 @@ export class DefaultLoginComponentService implements LoginComponentService {
special: false,
};
let state = await this.passwordGenerationService.generatePassword(passwordOptions);
// TODO-rr-bw: verify this is correct. Pulling this from original browser login component launchSsoBrowser method
if (clientId === "browser") {
state += ":clientId=browser";
}
const state = await this.passwordGenerationService.generatePassword(passwordOptions);
const codeVerifier = await this.passwordGenerationService.generatePassword(passwordOptions);
const codeVerifierHash = await this.cryptoFunctionService.hash(codeVerifier, "sha256");
@@ -64,20 +60,16 @@ export class DefaultLoginComponentService implements LoginComponentService {
// Build URL
const env = await firstValueFrom(this.environmentService.environment$);
let url = env.getWebVaultUrl();
// TODO-rr-bw: verify this is correct. Pulling this from original browser login component launchSsoBrowser method
if (url == null) {
url = "https://vault.bitwarden.com";
}
const webVaultUrl = env.getWebVaultUrl();
const redirectUri =
clientId === "browser"
? url + "/sso-connector.html" // Browser
? webVaultUrl + "/sso-connector.html" // Browser
: "bitwarden://sso-callback"; // Desktop
// Launch browser window with URL
this.platformUtilsService.launchUri(
url +
webVaultUrl +
"/#/sso?clientId=" +
clientId +
"&redirectUri=" +