From bc543de307ffeb0185e4f8e0ca75ac687c1ab137 Mon Sep 17 00:00:00 2001 From: Thomas Rittson Date: Wed, 7 Apr 2021 12:47:50 +1000 Subject: [PATCH 1/3] 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 96a5744810..c85f4e4b62 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 6b38b73d98..4a8230925a 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 ead20bfbdc..c80c9d0400 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." } } From 05183149ade158493e33c39a275da77437be9eac Mon Sep 17 00:00:00 2001 From: Thomas Rittson Date: Wed, 7 Apr 2021 13:11:45 +1000 Subject: [PATCH 2/3] Fix linting --- src/app/send/add-edit.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/send/add-edit.component.ts b/src/app/send/add-edit.component.ts index 4a8230925a..eaa342d54a 100644 --- a/src/app/send/add-edit.component.ts +++ b/src/app/send/add-edit.component.ts @@ -8,7 +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 { TokenService } from 'jslib/abstractions/token.service'; import { UserService } from 'jslib/abstractions/user.service'; import { AddEditComponent as BaseAddEditComponent } from 'jslib/angular/components/send/add-edit.component'; From 737360b7209d233388f5113b8217266ca724592e Mon Sep 17 00:00:00 2001 From: Thomas Rittson Date: Fri, 9 Apr 2021 15:41:33 +1000 Subject: [PATCH 3/3] bump jslib --- jslib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jslib b/jslib index c395293e64..85893f5f9e 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit c395293e64d5e8e276ede7ed84649fadde60dcb0 +Subproject commit 85893f5f9efb201a45c5af54896a82e6eb185108