1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-03-12 13:39:14 +01:00

fill out desktop template and submit()

This commit is contained in:
rr-bw 2024-09-11 11:48:18 -07:00
parent b0f4ac1915
commit 234191e809
No known key found for this signature in database
GPG Key ID: 3FA13C3ADEE51D5D
2 changed files with 58 additions and 2 deletions

View File

@ -100,7 +100,7 @@
<!-- Link to Password Hint page -->
<a
class="tw-mt-2"
class="tw-mt-2 tw-font-semibold"
routerLink="/hint"
(mousedown)="goToHint()"
(click)="saveEmailSettings()"
@ -108,6 +108,7 @@
>
</div>
<!-- TODO-rr-bw: will we still be handling captcha? -->
<!-- Captcha iframe -->
<div [hidden]="!showCaptcha()">
<iframe id="hcaptcha_iframe" height="80" sandbox="allow-scripts allow-same-origin"></iframe>
@ -218,4 +219,46 @@
<!-------------------------------------------
Desktop UI State 2: Master Password Entry
-------------------------------------------->
<ng-container *ngIf="validatedEmail">
<div class="tw-grid tw-gap-4">
<div>
<!-- Master Password input -->
<bit-form-field class="!tw-mb-1">
<bit-label>{{ "masterPassword" | i18n }}</bit-label>
<input type="password" formControlName="masterPassword" bitInput />
<button type="button" bitIconButton bitSuffix bitPasswordInputToggle></button>
</bit-form-field>
<!-- Link to Password Hint page -->
<a
class="tw-font-semibold"
routerLink="/hint"
(mousedown)="goToHint()"
(click)="saveEmailSettings()"
>
{{ "getMasterPasswordHint" | i18n }}
</a>
</div>
<!-- Button to Login with Master Password -->
<button type="submit" bitButton bitFormButton block buttonType="primary">
<span> {{ "loginWithMasterPassword" | i18n }} </span>
</button>
<ng-container *ngIf="showLoginWithDevice && showPasswordless">
<div class="tw-text-center">{{ "or" | i18n }}</div>
<button
type="button"
bitButton
block
buttonType="secondary"
(click)="startAuthRequestLogin()"
>
<span><i class="bwi bwi-mobile"></i> {{ "loginWithDevice" | i18n }}</span>
</button>
</ng-container>
</div>
</ng-container>
</form>

View File

@ -97,7 +97,7 @@ export class LoginComponentV2 implements OnInit, OnDestroy {
// Desktop properties
deferFocus: boolean = null; // TODO-rr-bw: why initialize to null instead of false
showPassword = false; // TODO-rr-bw: is this still needed?
showPassword = false; // TODO-rr-bw: is this still needed? It seems we no longer need this now that we have bitPasswordInputToggle
constructor(
private activatedRoute: ActivatedRoute,
@ -153,6 +153,12 @@ export class LoginComponentV2 implements OnInit, OnDestroy {
}
submit = async (): Promise<void> => {
if (this.clientType === ClientType.Desktop) {
if (!this.validatedEmail) {
return;
}
}
const { email, masterPassword } = this.formGroup.value;
await this.setupCaptcha();
@ -188,6 +194,13 @@ export class LoginComponentV2 implements OnInit, OnDestroy {
await this.saveEmailSettings();
await this.handleAuthResult(authResult);
if (this.clientType === ClientType.Desktop) {
if (this.captchaSiteKey) {
const content = document.getElementById("content") as HTMLDivElement;
content.setAttribute("style", "width:335px");
}
}
};
/**