mirror of
https://github.com/bitwarden/browser
synced 2025-12-19 09:43:23 +00:00
Feature/use hcaptcha if bot (#1968)
* Add captcha to login page * Include log service in DI providers for api-action directive * Add captcha to register page * update jslib
This commit is contained in:
@@ -35,6 +35,9 @@
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-content-row" [hidden]="!showCaptcha()">
|
||||
<iframe id="hcaptcha_iframe" height="80"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-center">
|
||||
|
||||
@@ -80,9 +80,11 @@
|
||||
{{'masterPassHintDesc' | i18n}}
|
||||
</div>
|
||||
</div>
|
||||
<div [hidden]="!showCaptcha()"><iframe id="hcaptcha_iframe" height="80"></iframe></div>
|
||||
<div class="box last" *ngIf="showTerms">
|
||||
<div class="box-content">
|
||||
<div class="box-content-row box-content-row-checkbox box-content-row-checkbox-left" appBoxRow>
|
||||
<div class="box-content-row box-content-row-checkbox box-content-row-checkbox-left box-content-row-word-break"
|
||||
appBoxRow>
|
||||
<input type="checkbox" id="acceptPolicies" [(ngModel)]="acceptPolicies" name="AcceptPolicies">
|
||||
<label for="acceptPolicies">
|
||||
{{'acceptPolicies' | i18n}}<br>
|
||||
|
||||
@@ -4,6 +4,7 @@ import { Router } from '@angular/router';
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { AuthService } from 'jslib-common/abstractions/auth.service';
|
||||
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
||||
import { EnvironmentService } from 'jslib-common/abstractions/environment.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
@@ -19,8 +20,9 @@ export class RegisterComponent extends BaseRegisterComponent {
|
||||
constructor(authService: AuthService, router: Router,
|
||||
i18nService: I18nService, cryptoService: CryptoService,
|
||||
apiService: ApiService, stateService: StateService,
|
||||
platformUtilsService: PlatformUtilsService, passwordGenerationService: PasswordGenerationService) {
|
||||
platformUtilsService: PlatformUtilsService, passwordGenerationService: PasswordGenerationService,
|
||||
environmentService: EnvironmentService) {
|
||||
super(authService, router, i18nService, cryptoService, apiService, stateService, platformUtilsService,
|
||||
passwordGenerationService);
|
||||
passwordGenerationService, environmentService);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,6 +283,10 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
word-break: break-all;
|
||||
|
||||
&.box-content-row-word-break {
|
||||
word-break: normal;
|
||||
}
|
||||
}
|
||||
|
||||
&.box-content-row-multi {
|
||||
|
||||
@@ -189,6 +189,12 @@ p.lead {
|
||||
}
|
||||
}
|
||||
|
||||
#hcaptcha_iframe {
|
||||
width: 100%;
|
||||
border: none;
|
||||
transition: height 0.25s linear;
|
||||
}
|
||||
|
||||
body.linux-webauthn {
|
||||
width: 485px !important;
|
||||
#web-authn-frame {
|
||||
|
||||
@@ -31,6 +31,7 @@ import { ExportService } from 'jslib-common/abstractions/export.service';
|
||||
import { FileUploadService } from 'jslib-common/abstractions/fileUpload.service';
|
||||
import { FolderService } from 'jslib-common/abstractions/folder.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
|
||||
import { NotificationsService } from 'jslib-common/abstractions/notifications.service';
|
||||
import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service';
|
||||
@@ -139,6 +140,7 @@ export function initFactory(platformUtilsService: PlatformUtilsService, i18nServ
|
||||
},
|
||||
{ provide: FolderService, useFactory: getBgService<FolderService>('folderService'), deps: [] },
|
||||
{ provide: CollectionService, useFactory: getBgService<CollectionService>('collectionService'), deps: [] },
|
||||
{ provide: LogService, useFactory: getBgService<ConsoleLogService>('logService'), deps: [] },
|
||||
{ provide: EnvironmentService, useFactory: getBgService<EnvironmentService>('environmentService'), deps: [] },
|
||||
{ provide: TotpService, useFactory: getBgService<TotpService>('totpService'), deps: [] },
|
||||
{ provide: TokenService, useFactory: getBgService<TokenService>('tokenService'), deps: [] },
|
||||
|
||||
Reference in New Issue
Block a user