From bc543de307ffeb0185e4f8e0ca75ac687c1ab137 Mon Sep 17 00:00:00 2001 From: Thomas Rittson Date: Wed, 7 Apr 2021 12:47:50 +1000 Subject: [PATCH] Require user to verify email to use file Send --- src/app/app.component.ts | 9 +++++++++ src/app/send/add-edit.component.ts | 5 +++-- src/locales/en/messages.json | 6 ++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 96a57448..c85f4e4b 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -217,6 +217,15 @@ export class AppComponent implements OnInit { this.openModal(PremiumComponent, this.premiumRef); } break; + case 'emailVerificationRequired': + const emailVerificationConfirmed = await this.platformUtilsService.showDialog( + this.i18nService.t('emailVerificationRequiredDesc'), + this.i18nService.t('emailVerificationRequired'), + this.i18nService.t('learnMore'), this.i18nService.t('cancel')); + if (emailVerificationConfirmed) { + this.platformUtilsService.launchUri('https://bitwarden.com/help/article/create-bitwarden-account/'); + } + break; case 'syncVault': try { await this.syncService.fullSync(true, true); diff --git a/src/app/send/add-edit.component.ts b/src/app/send/add-edit.component.ts index 6b38b73d..4a823092 100644 --- a/src/app/send/add-edit.component.ts +++ b/src/app/send/add-edit.component.ts @@ -8,6 +8,7 @@ import { MessagingService } from 'jslib/abstractions/messaging.service'; import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; import { PolicyService } from 'jslib/abstractions/policy.service'; import { SendService } from 'jslib/abstractions/send.service'; +import { TokenService } from 'jslib/abstractions'; import { UserService } from 'jslib/abstractions/user.service'; import { AddEditComponent as BaseAddEditComponent } from 'jslib/angular/components/send/add-edit.component'; @@ -20,9 +21,9 @@ export class AddEditComponent extends BaseAddEditComponent { constructor(i18nService: I18nService, platformUtilsService: PlatformUtilsService, environmentService: EnvironmentService, datePipe: DatePipe, sendService: SendService, userService: UserService, - messagingService: MessagingService, policyService: PolicyService) { + messagingService: MessagingService, policyService: PolicyService, tokenService: TokenService) { super(i18nService, platformUtilsService, environmentService, - datePipe, sendService, userService, messagingService, policyService); + datePipe, sendService, userService, messagingService, policyService, tokenService); } async refresh() { diff --git a/src/locales/en/messages.json b/src/locales/en/messages.json index ead20bfb..c80c9d04 100644 --- a/src/locales/en/messages.json +++ b/src/locales/en/messages.json @@ -1662,5 +1662,11 @@ }, "sendOptionsPolicyInEffect": { "message": "One or more organization policies are affecting your Send options." + }, + "emailVerificationRequired": { + "message": "Email Verification Required" + }, + "emailVerificationRequiredDesc": { + "message": "You must verify your email to use this feature." } }