mirror of
https://github.com/bitwarden/browser
synced 2025-12-06 00:13:28 +00:00
[PM-5979] Refactor EnvironmentService (#8040)
Refactor environment service to emit a single observable. This required significant changes to how the environment service behaves and tackles much of the tech debt planned for it.
This commit is contained in:
@@ -121,7 +121,7 @@ export class LastPassDirectImportService {
|
||||
this.oidcClient = new OidcClient({
|
||||
authority: this.vault.userType.openIDConnectAuthorityBase,
|
||||
client_id: this.vault.userType.openIDConnectClientId,
|
||||
redirect_uri: this.getOidcRedirectUrl(),
|
||||
redirect_uri: await this.getOidcRedirectUrl(),
|
||||
response_type: "code",
|
||||
scope: this.vault.userType.oidcScope,
|
||||
response_mode: "query",
|
||||
@@ -151,12 +151,13 @@ export class LastPassDirectImportService {
|
||||
return redirectUri + "&" + params;
|
||||
}
|
||||
|
||||
private getOidcRedirectUrl() {
|
||||
private async getOidcRedirectUrl() {
|
||||
const clientType = this.platformUtilsService.getClientType();
|
||||
if (clientType === ClientType.Desktop) {
|
||||
return "bitwarden://import-callback-lp";
|
||||
}
|
||||
const webUrl = this.environmentService.getWebVaultUrl();
|
||||
const env = await firstValueFrom(this.environmentService.environment$);
|
||||
const webUrl = env.getWebVaultUrl();
|
||||
return webUrl + "/sso-connector.html?lp=1";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user