mirror of
https://github.com/bitwarden/browser
synced 2025-12-13 14:53:33 +00:00
Added terms/privacy variables & logic (#193)
This commit is contained in:
@@ -24,6 +24,8 @@ export class RegisterComponent {
|
|||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
masterPasswordScore: number;
|
masterPasswordScore: number;
|
||||||
referenceData: ReferenceEventRequest;
|
referenceData: ReferenceEventRequest;
|
||||||
|
showTerms = true;
|
||||||
|
acceptPolicies: boolean = false;
|
||||||
|
|
||||||
protected successRoute = 'login';
|
protected successRoute = 'login';
|
||||||
private masterPasswordStrengthTimeout: any;
|
private masterPasswordStrengthTimeout: any;
|
||||||
@@ -32,7 +34,9 @@ export class RegisterComponent {
|
|||||||
protected i18nService: I18nService, protected cryptoService: CryptoService,
|
protected i18nService: I18nService, protected cryptoService: CryptoService,
|
||||||
protected apiService: ApiService, protected stateService: StateService,
|
protected apiService: ApiService, protected stateService: StateService,
|
||||||
protected platformUtilsService: PlatformUtilsService,
|
protected platformUtilsService: PlatformUtilsService,
|
||||||
protected passwordGenerationService: PasswordGenerationService) { }
|
protected passwordGenerationService: PasswordGenerationService) {
|
||||||
|
this.showTerms = !platformUtilsService.isSelfHost();
|
||||||
|
}
|
||||||
|
|
||||||
get masterPasswordScoreWidth() {
|
get masterPasswordScoreWidth() {
|
||||||
return this.masterPasswordScore == null ? 0 : (this.masterPasswordScore + 1) * 20;
|
return this.masterPasswordScore == null ? 0 : (this.masterPasswordScore + 1) * 20;
|
||||||
@@ -65,6 +69,12 @@ export class RegisterComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async submit() {
|
async submit() {
|
||||||
|
if (!this.acceptPolicies && this.showTerms) {
|
||||||
|
this.platformUtilsService.showToast('error', this.i18nService.t('errorOccurred'),
|
||||||
|
this.i18nService.t('acceptPoliciesError'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.email == null || this.email === '') {
|
if (this.email == null || this.email === '') {
|
||||||
this.platformUtilsService.showToast('error', this.i18nService.t('errorOccurred'),
|
this.platformUtilsService.showToast('error', this.i18nService.t('errorOccurred'),
|
||||||
this.i18nService.t('emailRequired'));
|
this.i18nService.t('emailRequired'));
|
||||||
|
|||||||
Reference in New Issue
Block a user