mirror of
https://github.com/bitwarden/browser
synced 2025-12-19 17:53:39 +00:00
[Enterprise] Added environment checks (#559)
* Update jslib (2b6657a->28d21ca) * Environment variable checks
This commit is contained in:
2
jslib
2
jslib
Submodule jslib updated: 2b6657a293...28d21ca5df
@@ -9,6 +9,7 @@ import { ActivatedRoute } from '@angular/router';
|
|||||||
import { BroadcasterService } from 'jslib/angular/services/broadcaster.service';
|
import { BroadcasterService } from 'jslib/angular/services/broadcaster.service';
|
||||||
|
|
||||||
import { UserService } from 'jslib/abstractions/user.service';
|
import { UserService } from 'jslib/abstractions/user.service';
|
||||||
|
import { EnvironmentService } from 'jslib/abstractions/environment.service';
|
||||||
|
|
||||||
import { Organization } from 'jslib/models/domain/organization';
|
import { Organization } from 'jslib/models/domain/organization';
|
||||||
|
|
||||||
@@ -22,11 +23,20 @@ export class OrganizationLayoutComponent implements OnInit, OnDestroy {
|
|||||||
organization: Organization;
|
organization: Organization;
|
||||||
|
|
||||||
private organizationId: string;
|
private organizationId: string;
|
||||||
|
private enterpriseUrl: string;
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute, private userService: UserService,
|
constructor(private route: ActivatedRoute, private userService: UserService,
|
||||||
private broadcasterService: BroadcasterService, private ngZone: NgZone) { }
|
private broadcasterService: BroadcasterService, private environmentService: EnvironmentService,
|
||||||
|
private ngZone: NgZone) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
this.enterpriseUrl = 'https://enterprise.bitwarden.com';
|
||||||
|
if (this.environmentService.enterpriseUrl != null) {
|
||||||
|
this.enterpriseUrl = this.environmentService.enterpriseUrl;
|
||||||
|
} else if (this.environmentService.baseUrl != null) {
|
||||||
|
this.enterpriseUrl = this.environmentService.baseUrl + '/enterprise';
|
||||||
|
}
|
||||||
|
|
||||||
document.body.classList.remove('layout_frontend');
|
document.body.classList.remove('layout_frontend');
|
||||||
this.route.params.subscribe(async (params) => {
|
this.route.params.subscribe(async (params) => {
|
||||||
this.organizationId = params.organizationId;
|
this.organizationId = params.organizationId;
|
||||||
|
|||||||
@@ -140,6 +140,8 @@ export function initFactory(): Function {
|
|||||||
} else {
|
} else {
|
||||||
environmentService.notificationsUrl = isDev ? 'http://localhost:61840' :
|
environmentService.notificationsUrl = isDev ? 'http://localhost:61840' :
|
||||||
'https://notifications.bitwarden.com'; // window.location.origin + '/notifications';
|
'https://notifications.bitwarden.com'; // window.location.origin + '/notifications';
|
||||||
|
environmentService.enterpriseUrl = isDev ? 'http://localhost:61840' :
|
||||||
|
'https://enterprise.bitwarden.com'; // window.location.origin + '/enterprise';
|
||||||
}
|
}
|
||||||
apiService.setUrls({
|
apiService.setUrls({
|
||||||
base: isDev ? null : window.location.origin,
|
base: isDev ? null : window.location.origin,
|
||||||
|
|||||||
Reference in New Issue
Block a user