mirror of https://github.com/bitwarden/web.git
Browse Source
* validate password against org policy and create update-password component
* linting and prettier
* [bug] Default rememberEmail to true (#1429)
* switching the dashes to underscores for the branch name (#1433)
(cherry picked from commit 8910430dfb)
* fix merge conflicts
* Update src/app/accounts/update-password.component.html
Co-authored-by: Justin Baur <admin@justinbaur.com>
* Update src/locales/en/messages.json
Co-authored-by: Justin Baur <admin@justinbaur.com>
* update jslib
* prettier
Co-authored-by: Addison Beck <abeck@bitwarden.com>
Co-authored-by: Joseph Flinn <58369717+joseph-flinn@users.noreply.github.com>
Co-authored-by: Justin Baur <admin@justinbaur.com>
pull/1435/head
7 changed files with 208 additions and 5 deletions
@ -1 +1 @@ |
|||||||
Subproject commit 92a65b7b368a8dbf55350657674c90169b04c30b |
Subproject commit 009f69fcb1fc2168f015e5bc6de3a8583cbfe5fd |
||||||
@ -0,0 +1,90 @@ |
|||||||
|
<form #form (ngSubmit)="submit()" [appApiAction]="formPromise" ngNativeValidate autocomplete="off"> |
||||||
|
<div class="row justify-content-md-center mt-5"> |
||||||
|
<div class="col-4"> |
||||||
|
<p class="lead text-center mb-4">{{ "updateMasterPassword" | i18n }}</p> |
||||||
|
<div class="card d-block"> |
||||||
|
<div class="card-body"> |
||||||
|
<app-callout type="warning">{{ "masterPasswordInvalidWarning" | i18n }} </app-callout> |
||||||
|
<app-callout |
||||||
|
type="info" |
||||||
|
[enforcedPolicyOptions]="enforcedPolicyOptions" |
||||||
|
*ngIf="enforcedPolicyOptions" |
||||||
|
></app-callout> |
||||||
|
|
||||||
|
<form |
||||||
|
#form |
||||||
|
(ngSubmit)="submit()" |
||||||
|
[appApiAction]="formPromise" |
||||||
|
ngNativeValidate |
||||||
|
autocomplete="off" |
||||||
|
> |
||||||
|
<div class="row"> |
||||||
|
<div class="col-6"> |
||||||
|
<div class="form-group"> |
||||||
|
<label for="currentMasterPassword">{{ "currentMasterPass" | i18n }}</label> |
||||||
|
<input |
||||||
|
id="currentMasterPassword" |
||||||
|
type="password" |
||||||
|
name="MasterPasswordHash" |
||||||
|
class="form-control" |
||||||
|
[(ngModel)]="currentMasterPassword" |
||||||
|
required |
||||||
|
appInputVerbatim |
||||||
|
/> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="row"> |
||||||
|
<div class="col-6"> |
||||||
|
<div class="form-group"> |
||||||
|
<label for="newMasterPassword">{{ "newMasterPass" | i18n }}</label> |
||||||
|
<input |
||||||
|
id="newMasterPassword" |
||||||
|
type="password" |
||||||
|
name="NewMasterPasswordHash" |
||||||
|
class="form-control mb-1" |
||||||
|
[(ngModel)]="masterPassword" |
||||||
|
(input)="updatePasswordStrength()" |
||||||
|
required |
||||||
|
appInputVerbatim |
||||||
|
autocomplete="new-password" |
||||||
|
/> |
||||||
|
<app-password-strength |
||||||
|
[score]="masterPasswordScore" |
||||||
|
[showText]="true" |
||||||
|
></app-password-strength> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="col-6"> |
||||||
|
<div class="form-group"> |
||||||
|
<label for="masterPasswordRetype">{{ "confirmNewMasterPass" | i18n }}</label> |
||||||
|
<input |
||||||
|
id="masterPasswordRetype" |
||||||
|
type="password" |
||||||
|
name="MasterPasswordRetype" |
||||||
|
class="form-control" |
||||||
|
[(ngModel)]="masterPasswordRetype" |
||||||
|
required |
||||||
|
appInputVerbatim |
||||||
|
autocomplete="new-password" |
||||||
|
/> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<button type="submit" class="btn btn-primary btn-submit" [disabled]="form.loading"> |
||||||
|
<i |
||||||
|
class="fa fa-spinner fa-spin" |
||||||
|
title="{{ 'loading' | i18n }}" |
||||||
|
aria-hidden="true" |
||||||
|
></i> |
||||||
|
<span>{{ "changeMasterPassword" | i18n }}</span> |
||||||
|
</button> |
||||||
|
<button (click)="cancel()" type="button" class="btn btn-outline-secondary"> |
||||||
|
<span>{{ "cancel" | i18n }}</span> |
||||||
|
</button> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</form> |
||||||
@ -0,0 +1,52 @@ |
|||||||
|
import { Component } from "@angular/core"; |
||||||
|
import { ActivatedRoute, Router } from "@angular/router"; |
||||||
|
|
||||||
|
import { first } from "rxjs/operators"; |
||||||
|
|
||||||
|
import { ApiService } from "jslib-common/abstractions/api.service"; |
||||||
|
import { CryptoService } from "jslib-common/abstractions/crypto.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 { PasswordGenerationService } from "jslib-common/abstractions/passwordGeneration.service"; |
||||||
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service"; |
||||||
|
import { PolicyService } from "jslib-common/abstractions/policy.service"; |
||||||
|
import { SyncService } from "jslib-common/abstractions/sync.service"; |
||||||
|
|
||||||
|
import { UpdatePasswordComponent as BaseUpdatePasswordComponent } from "jslib-angular/components/update-password.component"; |
||||||
|
import { StateService } from "jslib-common/abstractions/state.service"; |
||||||
|
import { UserVerificationService } from "jslib-common/abstractions/userVerification.service"; |
||||||
|
|
||||||
|
@Component({ |
||||||
|
selector: "app-update-password", |
||||||
|
templateUrl: "update-password.component.html", |
||||||
|
}) |
||||||
|
export class UpdatePasswordComponent extends BaseUpdatePasswordComponent { |
||||||
|
constructor( |
||||||
|
router: Router, |
||||||
|
i18nService: I18nService, |
||||||
|
platformUtilsService: PlatformUtilsService, |
||||||
|
passwordGenerationService: PasswordGenerationService, |
||||||
|
policyService: PolicyService, |
||||||
|
cryptoService: CryptoService, |
||||||
|
messagingService: MessagingService, |
||||||
|
apiService: ApiService, |
||||||
|
logService: LogService, |
||||||
|
stateService: StateService, |
||||||
|
userVerificationService: UserVerificationService |
||||||
|
) { |
||||||
|
super( |
||||||
|
router, |
||||||
|
i18nService, |
||||||
|
platformUtilsService, |
||||||
|
passwordGenerationService, |
||||||
|
policyService, |
||||||
|
cryptoService, |
||||||
|
messagingService, |
||||||
|
apiService, |
||||||
|
stateService, |
||||||
|
userVerificationService, |
||||||
|
logService |
||||||
|
); |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue