From b251e1f73c9922b6811701bf96bb2db59aa4e619 Mon Sep 17 00:00:00 2001 From: Vincent Salucci <26154748+vincentsalucci@users.noreply.github.com> Date: Fri, 28 Aug 2020 08:56:51 -0500 Subject: [PATCH] [SSO] Add set-password loading placeholder (#626) * Preparing for new jslib // removed resetMasterPassword variable // Added sync service * initial commit of loading set password * Update jslib (e55528e -> 700e945) * center justify text * Reverted testing data --- src/app/accounts/set-password.component.html | 6 ++++- src/app/accounts/set-password.component.ts | 6 +++-- src/app/accounts/two-factor.component.ts | 26 +++----------------- 3 files changed, 12 insertions(+), 26 deletions(-) diff --git a/src/app/accounts/set-password.component.html b/src/app/accounts/set-password.component.html index 42d3484c87..e3eeacd3fd 100644 --- a/src/app/accounts/set-password.component.html +++ b/src/app/accounts/set-password.component.html @@ -3,7 +3,11 @@

{{'setMasterPassword' | i18n}}

-
+
+ + {{'loading' | i18n}} +
+
{{'ssoCompleteRegistration' | i18n}}
diff --git a/src/app/accounts/set-password.component.ts b/src/app/accounts/set-password.component.ts index 04c94fcf51..275c5eb299 100644 --- a/src/app/accounts/set-password.component.ts +++ b/src/app/accounts/set-password.component.ts @@ -8,6 +8,7 @@ import { MessagingService } from 'jslib/abstractions/messaging.service'; import { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service'; import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; import { PolicyService } from 'jslib/abstractions/policy.service'; +import { SyncService } from 'jslib/abstractions/sync.service'; import { UserService } from 'jslib/abstractions/user.service'; import { @@ -22,8 +23,9 @@ export class SetPasswordComponent extends BaseSetPasswordComponent { constructor(apiService: ApiService, i18nService: I18nService, cryptoService: CryptoService, messagingService: MessagingService, userService: UserService, passwordGenerationService: PasswordGenerationService, - platformUtilsService: PlatformUtilsService, policyService: PolicyService, router: Router) { + platformUtilsService: PlatformUtilsService, policyService: PolicyService, router: Router, + syncService: SyncService) { super(i18nService, cryptoService, messagingService, userService, passwordGenerationService, - platformUtilsService, policyService, router, apiService); + platformUtilsService, policyService, router, apiService, syncService); } } diff --git a/src/app/accounts/two-factor.component.ts b/src/app/accounts/two-factor.component.ts index f8b533bc3f..267b5cdf9c 100644 --- a/src/app/accounts/two-factor.component.ts +++ b/src/app/accounts/two-factor.component.ts @@ -5,10 +5,7 @@ import { ViewContainerRef, } from '@angular/core'; -import { - ActivatedRoute, - Router, -} from '@angular/router'; +import { Router } from '@angular/router'; import { TwoFactorOptionsComponent } from './two-factor-options.component'; @@ -37,25 +34,12 @@ export class TwoFactorComponent extends BaseTwoFactorComponent { i18nService: I18nService, apiService: ApiService, platformUtilsService: PlatformUtilsService, stateService: StateService, environmentService: EnvironmentService, private componentFactoryResolver: ComponentFactoryResolver, - storageService: StorageService, private route: ActivatedRoute) { + storageService: StorageService) { super(authService, router, i18nService, apiService, platformUtilsService, window, environmentService, stateService, storageService); this.onSuccessfulLoginNavigate = this.goAfterLogIn; } - async ngOnInit() { - const queryParamsSub = this.route.queryParams.subscribe((qParams) => { - if (qParams.resetMasterPassword != null) { - this.resetMasterPassword = qParams.resetMasterPassword; - } - - if (queryParamsSub != null) { - queryParamsSub.unsubscribe(); - } - }); - super.ngOnInit(); - } - anotherMethod() { const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent); const modal = this.twoFactorOptionsModal.createComponent(factory).instance; @@ -82,11 +66,7 @@ export class TwoFactorComponent extends BaseTwoFactorComponent { this.router.navigate([loginRedirect.route], { queryParams: loginRedirect.qParams }); await this.stateService.remove('loginRedirect'); } else { - this.router.navigate([this.successRoute], { - queryParams: { - resetMasterPassword: this.resetMasterPassword, - }, - }); + this.router.navigate([this.successRoute]); } } }