-
+
+
+
+
+
{{'setMasterPasswordRedirect' | i18n}}
+
+
+
+
+
+
+
diff --git a/src/app/accounts/sso.component.ts b/src/app/accounts/sso.component.ts
index 1084aed4..8555927d 100644
--- a/src/app/accounts/sso.component.ts
+++ b/src/app/accounts/sso.component.ts
@@ -8,7 +8,9 @@ import {
import { ApiService } from 'jslib/abstractions/api.service';
import { AuthService } from 'jslib/abstractions/auth.service';
import { CryptoFunctionService } from 'jslib/abstractions/cryptoFunction.service';
+import { EnvironmentService } from 'jslib/abstractions/environment.service';
import { I18nService } from 'jslib/abstractions/i18n.service';
+import { MessagingService } from 'jslib/abstractions/messaging.service';
import { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service';
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
import { StateService } from 'jslib/abstractions/state.service';
@@ -21,16 +23,39 @@ import { SsoComponent as BaseSsoComponent } from 'jslib/angular/components/sso.c
templateUrl: 'sso.component.html',
})
export class SsoComponent extends BaseSsoComponent {
+ showMasterPassRedirect: boolean = false;
+
constructor(authService: AuthService, router: Router,
i18nService: I18nService, route: ActivatedRoute,
storageService: StorageService, stateService: StateService,
platformUtilsService: PlatformUtilsService, apiService: ApiService,
cryptoFunctionService: CryptoFunctionService,
- passwordGenerationService: PasswordGenerationService) {
+ passwordGenerationService: PasswordGenerationService, private messagingService: MessagingService,
+ private environmentService: EnvironmentService) {
super(authService, router, i18nService, route, storageService, stateService, platformUtilsService,
apiService, cryptoFunctionService, passwordGenerationService);
this.successRoute = '/tabs/dashboard';
this.redirectUri = 'bwdc://sso-callback';
this.clientId = 'connector';
+ this.onSuccessfulLoginChangePasswordNavigate = this.redirectSetMasterPass;
+ }
+
+ async redirectSetMasterPass() {
+ this.showMasterPassRedirect = true;
+ }
+
+ launchWebVault() {
+ const webUrl = this.environmentService.webVaultUrl == null ? 'https://vault.bitwarden.com' :
+ this.environmentService.webVaultUrl;
+
+ this.platformUtilsService.launchUri(webUrl);
+ }
+
+ async logOut() {
+ const confirmed = await this.platformUtilsService.showDialog(this.i18nService.t('logOutConfirmation'),
+ this.i18nService.t('logOut'), this.i18nService.t('logOut'), this.i18nService.t('cancel'));
+ if (confirmed) {
+ this.messagingService.send('logout');
+ }
}
}
diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts
index b8b6ae52..82fda652 100644
--- a/src/app/app-routing.module.ts
+++ b/src/app/app-routing.module.ts
@@ -8,7 +8,6 @@ import { AuthGuardService } from './services/auth-guard.service';
import { LaunchGuardService } from './services/launch-guard.service';
import { LoginComponent } from './accounts/login.component';
-import { SetPasswordComponent } from './accounts/set-password.component';
import { SsoComponent } from './accounts/sso.component';
import { TwoFactorComponent } from './accounts/two-factor.component';
import { DashboardComponent } from './tabs/dashboard.component';
@@ -25,7 +24,6 @@ const routes: Routes = [
},
{ path: '2fa', component: TwoFactorComponent },
{ path: 'sso', component: SsoComponent },
- { path: 'set-password', component: SetPasswordComponent },
{
path: 'tabs',
component: TabsComponent,
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index 1f2f2ece..30fccc20 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -26,7 +26,6 @@ import { TwoFactorOptionsComponent } from './accounts/two-factor-options.compone
import { TwoFactorComponent } from './accounts/two-factor.component';
import { DashboardComponent } from './tabs/dashboard.component';
import { MoreComponent } from './tabs/more.component';
-import { SetPasswordComponent } from './accounts/set-password.component';
import { SettingsComponent } from './tabs/settings.component';
import { TabsComponent } from './tabs/tabs.component';
@@ -73,7 +72,6 @@ import { SearchCiphersPipe } from 'jslib/angular/pipes/search-ciphers.pipe';
ModalComponent,
MoreComponent,
SearchCiphersPipe,
- SetPasswordComponent,
SettingsComponent,
SsoComponent,
StopClickDirective,
diff --git a/src/locales/en/messages.json b/src/locales/en/messages.json
index 70e48c17..c1500f5e 100644
--- a/src/locales/en/messages.json
+++ b/src/locales/en/messages.json
@@ -716,5 +716,11 @@
},
"loading": {
"message": "Loading"
+ },
+ "setMasterPasswordRedirect": {
+ "message": "In order to log in with SSO from the Directory Connector, you must first log in through the web vault to set your master password."
+ },
+ "launchWebVault": {
+ "message": "Launch Web Vault"
}
}