1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 14:53:33 +00:00

Add helper methods to EnvironmentService for retrieving urls (#435)

This commit is contained in:
Oscar Hinton
2021-07-23 20:03:52 +02:00
committed by GitHub
parent c77441b353
commit de288913e4
19 changed files with 234 additions and 158 deletions

View File

@@ -279,10 +279,7 @@ export class LoginCommand {
}
});
let foundPort = false;
let webUrl = this.environmentService.getWebVaultUrl();
if (webUrl == null) {
webUrl = 'https://vault.bitwarden.com';
}
const webUrl = this.environmentService.getWebVaultUrl();
for (let port = 8065; port <= 8070; port++) {
try {
this.ssoRedirectUri = 'http://localhost:' + port;

View File

@@ -4,6 +4,7 @@ import * as fe from 'node-fetch';
import { ApiService } from 'jslib-common/services/api.service';
import { EnvironmentService } from 'jslib-common/abstractions/environment.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { TokenService } from 'jslib-common/abstractions/token.service';
@@ -15,8 +16,9 @@ import { TokenService } from 'jslib-common/abstractions/token.service';
export class NodeApiService extends ApiService {
constructor(tokenService: TokenService, platformUtilsService: PlatformUtilsService,
logoutCallback: (expired: boolean) => Promise<void>, customUserAgent: string = null) {
super(tokenService, platformUtilsService, logoutCallback, customUserAgent);
environmentService: EnvironmentService, logoutCallback: (expired: boolean) => Promise<void>,
customUserAgent: string = null) {
super(tokenService, platformUtilsService, environmentService, logoutCallback, customUserAgent);
}
nativeFetch(request: Request): Promise<Response> {