mirror of
https://github.com/bitwarden/browser
synced 2026-01-07 19:13:39 +00:00
* [SG-163] Two step login flow web (#3648) * two step login flow * moved code from old branch and reafctored * fixed review comments * [SG-164] Two Step Login Flow - Browser (#3793) * Add new messages * Remove SSO button from home component * Change create account button to text * Add top padding to create account link * Add email input to HomeComponent * Add continue button to email input * Add form to home component * Retreive email from state service * Redirect to login after submit * Add error message for invalid email * Remove email input from login component * Remove loggingInTo from under MP input * Style the MP hint link * Add self hosted domain to email form * Made the mp hint link bold * Add the new login button * Style app-private-mode-warning in its component * Bitwarden -> Login text change * Remove the old login button * Cancel -> Close text change * Add avatar to login header * Login -> LoginWithMasterPassword text change * Add SSO button to login screen * Add not you button * Allow all clients to use the email query param on the login component * Introduct HomeGuard * Clear remembered email when clicking Not You * Make remember email opt-in * Use formGroup.patchValue instead of directly patching individual controls * [SG-165] Desktop login flow changes (#3814) * two step login flow * moved code from old branch and reafctored * fixed review comments * Make toggleValidateEmail in base class public * Add desktop login messages * Desktop login flow changes * Fix known device api error * Only submit if email has been validated * Clear remembered email when switching accounts * Fix merge issue * Add 'login with another device' button * Remove 'log in with another device' button for now * Pin login pag content to top instead of center justified * Leave email if 'Not you?' is clicked * Continue when enter is hit on email input Co-authored-by: gbubemismith <gsmithwalter@gmail.com> * [SG-750] and [SG-751] Web two step login bug fixes (#3843) * Continue when enter is hit on email input * Mark email input as touched on 'continue' so field is validated * disable login with device on self-hosted (#3895) * [SG-753] Keep email after hint component is launched in browser (#3883) * Keep email after hint component is launched in browser * Use query params instead of state for consistency * Send email and rememberEmail to home component on navigation (#3897) * removed avatar and close button from the password screen (#3901) * [SG-781] Remove extra login page and remove rememberEmail code (#3902) * Remove browser home guard * Always remember email for browser * Remove login landing page button * [SG-782] Add login service to streamline login form data persistence (#3911) * Add login service and abstraction * Inject login service into apps * Inject and use new service in login component * Use service in hint component to prefill email * Add method in LoginService to clear service values * Add LoginService to two-factor component to clear values * make login.service variables private Co-authored-by: Gbubemi Smith <gsmith@bitwarden.com> Co-authored-by: Addison Beck <addisonbeck1@gmail.com> Co-authored-by: Robyn MacCallum <robyntmaccallum@gmail.com> Co-authored-by: gbubemismith <gsmithwalter@gmail.com>
138 lines
3.9 KiB
HTML
138 lines
3.9 KiB
HTML
<form
|
|
#form
|
|
(ngSubmit)="submit()"
|
|
[appApiAction]="formPromise"
|
|
class="tw-container tw-mx-auto"
|
|
[formGroup]="formGroup"
|
|
>
|
|
<div
|
|
class="tw-mx-auto tw-mt-5 tw-flex tw-max-w-lg tw-flex-col tw-items-center tw-justify-center tw-p-8"
|
|
>
|
|
<div>
|
|
<img class="logo logo-themed" alt="Bitwarden" />
|
|
<p class="tw-mx-4 tw-mt-3 tw-mb-4 tw-text-center tw-text-xl">
|
|
{{ "loginOrCreateNewAccount" | i18n }}
|
|
</p>
|
|
<div
|
|
class="tw-mt-3 tw-rounded-md tw-border tw-border-solid tw-border-secondary-300 tw-bg-background tw-p-6"
|
|
>
|
|
<ng-container *ngIf="!validatedEmail; else loginPage">
|
|
<div class="tw-mb-3">
|
|
<bit-form-field>
|
|
<bit-label>{{ "emailAddress" | i18n }}</bit-label>
|
|
<input
|
|
id="login_input_email"
|
|
bitInput
|
|
type="email"
|
|
formControlName="email"
|
|
(keyup.enter)="validateEmail()"
|
|
/>
|
|
</bit-form-field>
|
|
</div>
|
|
|
|
<div class="tw-mb-3 tw-flex tw-items-start">
|
|
<div class="tw-flex tw-h-6 tw-items-center">
|
|
<input
|
|
id="login_input_remember-email"
|
|
class="tw-w-4 tw-rounded tw-border"
|
|
bitInput
|
|
type="checkbox"
|
|
formControlName="rememberEmail"
|
|
/>
|
|
</div>
|
|
<bit-label class="ml-2">
|
|
{{ "rememberEmail" | i18n }}
|
|
</bit-label>
|
|
</div>
|
|
|
|
<div class="tw-mb-3">
|
|
<button
|
|
bitButton
|
|
type="button"
|
|
buttonType="primary"
|
|
class="tw-w-full"
|
|
[disabled]="form.loading"
|
|
(click)="validateEmail()"
|
|
>
|
|
<span> {{ "continue" | i18n }} </span>
|
|
</button>
|
|
</div>
|
|
|
|
<hr />
|
|
|
|
<p class="tw-m-0 tw-text-sm">
|
|
{{ "newAroundHere" | i18n }}
|
|
<a routerLink="/register">{{ "createAccount" | i18n }}</a>
|
|
</p>
|
|
</ng-container>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
<ng-template [formGroup]="formGroup" #loginPage>
|
|
<div class="tw-mb-3">
|
|
<bit-form-field>
|
|
<bit-label>{{ "masterPass" | i18n }}</bit-label>
|
|
<input
|
|
id="login_input_master-password"
|
|
bitInput
|
|
type="{{ showPassword ? 'text' : 'password' }}"
|
|
formControlName="masterPassword"
|
|
/>
|
|
<button type="button" bitSuffix bitButton (click)="togglePassword()">
|
|
<i
|
|
aria-hidden="true"
|
|
class="bwi bwi-lg bwi-eye"
|
|
[ngClass]="{ 'bwi-eye': !showPassword, 'bwi-eye-slash': showPassword }"
|
|
></i>
|
|
</button>
|
|
<bit-hint>
|
|
<a routerLink="/hint" (click)="setFormValues()">{{ "getMasterPasswordHint" | i18n }}</a>
|
|
</bit-hint>
|
|
</bit-form-field>
|
|
</div>
|
|
|
|
<div [hidden]="!showCaptcha()">
|
|
<iframe id="hcaptcha_iframe" height="80"></iframe>
|
|
</div>
|
|
|
|
<div class="tw-mb-3 tw-flex tw-space-x-4">
|
|
<button bitButton buttonType="primary" type="submit" [block]="true" [loading]="form.loading">
|
|
<span> {{ "loginWithMasterPassword" | i18n }} </span>
|
|
</button>
|
|
</div>
|
|
|
|
<div class="tw-mb-3" *ngIf="showLoginWithDevice && showPasswordless">
|
|
<button
|
|
bitButton
|
|
type="button"
|
|
[block]="true"
|
|
buttonType="secondary"
|
|
(click)="startPasswordlessLogin()"
|
|
>
|
|
<span> <i class="bwi bwi-mobile"></i> {{ "loginWithDevice" | i18n }} </span>
|
|
</button>
|
|
</div>
|
|
|
|
<div class="tw-mb-3">
|
|
<a
|
|
routerLink="/sso"
|
|
(click)="setFormValues()"
|
|
bitButton
|
|
buttonType="secondary"
|
|
class="tw-w-full"
|
|
>
|
|
<i class="bwi bwi-provider tw-mr-2"></i>
|
|
{{ "enterpriseSingleSignOn" | i18n }}
|
|
</a>
|
|
</div>
|
|
|
|
<hr />
|
|
|
|
<div class="tw-m-0 tw-text-sm">
|
|
<p class="tw-mb-1">{{ "loggingInAs" | i18n }} {{ loggedEmail }}</p>
|
|
<a [routerLink]="[]" (click)="toggleValidateEmail(false)">{{ "notYou" | i18n }}</a>
|
|
</div>
|
|
</ng-template>
|