-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(webauthn-angular): Add Login form with register form
- Loading branch information
Showing
9 changed files
with
131 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 21 additions & 18 deletions
39
apps/webauthn-angular/src/app/pages/home/components/login/login.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
<mat-dialog-content> | ||
<div class="register"> | ||
<h4 class="register__title" mat-dialog-title>Login</h4> | ||
<form [formGroup]="loginForm" class="register__form"> | ||
<mat-form-field> | ||
<mat-label>UserName</mat-label> | ||
<input matInput formControlName="username" type="text" placeholder="Username" /> | ||
</mat-form-field> | ||
<div class="login"> | ||
<h4 class="login__title" mat-dialog-title>Log In</h4> | ||
<form [formGroup]="loginForm" class="login__form"> | ||
<mat-form-field> | ||
<mat-label>UserName</mat-label> | ||
<input matInput formControlName="username" type="text" placeholder="Username" /> | ||
</mat-form-field> | ||
|
||
<mat-form-field> | ||
<mat-label>Password</mat-label> | ||
<input matInput formControlName="password" type="password" placeholder="Password" /> | ||
</mat-form-field> | ||
<button mat-flat-button (click)="login()" [disabled]="loginForm.invalid"> | ||
Login | ||
</button> | ||
</form> | ||
</div> | ||
</mat-dialog-content> | ||
<mat-form-field> | ||
<mat-label>Password</mat-label> | ||
<input matInput formControlName="password" type="password" placeholder="Password" /> | ||
</mat-form-field> | ||
</form> | ||
</div> | ||
|
||
<div mat-dialog-actions class="login__actions"> | ||
<button mat-flat-button (click)="login()" [disabled]="loginForm.invalid || isLoading()"> | ||
Log In | ||
</button> | ||
|
||
<button mat-button (click)="goBack()" [disabled]="isLoading()">Go Back</button> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.login { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
padding: 1rem; | ||
|
||
&__title { | ||
text-align: center; | ||
} | ||
|
||
&__form { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
padding: 1rem; | ||
} | ||
|
||
&__actions { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 36 additions & 22 deletions
58
apps/webauthn-angular/src/app/pages/home/components/register/register.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,40 @@ | ||
<div class="register"> | ||
<mat-dialog-content style="overflow: hidden"> | ||
@if (!hasAccount()) { | ||
<ng-container [ngTemplateOutlet]="signIn" /> | ||
} @else { | ||
<app-login (onGoBack)="hideLogin()" (onLogin)="onClose.emit()" /> | ||
} | ||
</mat-dialog-content> | ||
</div> | ||
|
||
<ng-template #signIn> | ||
<h4 class="register__title" mat-dialog-title>Sign In</h4> | ||
<mat-dialog-content> | ||
<form [formGroup]="registerForm" class="register__form"> | ||
<mat-form-field> | ||
<mat-label>UserName</mat-label> | ||
<input matInput formControlName="username" type="text" placeholder="Username" /> | ||
</mat-form-field> | ||
<mat-form-field> | ||
<mat-label>Name</mat-label> | ||
<input matInput formControlName="name" type="text" placeholder="Name" /> | ||
</mat-form-field> | ||
<mat-form-field> | ||
<mat-label>Last Name</mat-label> | ||
<input matInput formControlName="lastName" type="text" placeholder="Last Name" /> | ||
</mat-form-field> | ||
<mat-form-field> | ||
<mat-label>Password</mat-label> | ||
<input matInput formControlName="password" type="password" placeholder="Password" /> | ||
</mat-form-field> | ||
<button mat-flat-button (click)="register()" [disabled]="registerForm.invalid"> | ||
<form [formGroup]="registerForm" class="register__form"> | ||
<mat-form-field> | ||
<mat-label>UserName</mat-label> | ||
<input matInput formControlName="username" type="text" placeholder="Username" /> | ||
</mat-form-field> | ||
<mat-form-field> | ||
<mat-label>Name</mat-label> | ||
<input matInput formControlName="name" type="text" placeholder="Name" /> | ||
</mat-form-field> | ||
<mat-form-field> | ||
<mat-label>Last Name</mat-label> | ||
<input matInput formControlName="lastName" type="text" placeholder="Last Name" /> | ||
</mat-form-field> | ||
<mat-form-field> | ||
<mat-label>Password</mat-label> | ||
<input matInput formControlName="password" type="password" placeholder="Password" /> | ||
</mat-form-field> | ||
|
||
<div mat-dialog-actions style="display: flex; flex-direction: column; gap: 1rem"> | ||
<button mat-flat-button (click)="register()" [disabled]="registerForm.invalid || isLoading()"> | ||
Register | ||
</button> | ||
</form> | ||
</mat-dialog-content> | ||
</div> | ||
<button mat-button (click)="showLogin()" [disabled]="isLoading()"> | ||
Have an account? Click here | ||
</button> | ||
</div> | ||
</form> | ||
</ng-template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters