Skip to content

Commit

Permalink
feat(assets): added sign in as guest feature
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyNahas committed May 23, 2018
1 parent 0f3b889 commit f8f65cb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
23 changes: 21 additions & 2 deletions src/module/components/auth/auth.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<mat-card-header fxLayoutAlign="end">
<button mat-icon-button
[color]="color"
matTooltip="schließen"
matTooltip="close"
matTooltipPosition="above"
(click)="passwordResetWished = false">
<mat-icon>close</mat-icon>
Expand Down Expand Up @@ -115,7 +115,7 @@
<mat-card-title>Registration</mat-card-title>
<div *ngIf="!authProcess.emailConfirmationSent; then register else confirm"></div>
<ng-template #register>
<mat-card-content>
<mat-card-content fxLayout="column" fxLayoutAlign="center center">
<form [formGroup]="signUpFormGroup" (ngSubmit)="signUpFormGroup.valid &&
authProcess.signUp
(signUpFormGroup.value.name,signUpFormGroup.value.email,signUpFormGroup.value.password)">
Expand Down Expand Up @@ -160,40 +160,59 @@

<!--password-->
<div>

<mat-form-field>

<input matInput
placeholder="Password"
type="password"
name="password"
[formControl]="sigUpPasswordFormControl"
required>
<mat-icon matSuffix [color]="color">lock</mat-icon>

<mat-hint align="end" aria-live="polite">
{{signUpFormGroup.value.password.length}} / 25
</mat-hint>

<mat-error *ngIf="sigUpPasswordFormControl.hasError('required')" class="cut-text">
Please do not forget the password
</mat-error>

<mat-error *ngIf="sigUpPasswordFormControl.hasError('minlength')" class="cut-text">
The password must be at least 6 characters long.
</mat-error>
<mat-error *ngIf="sigUpPasswordFormControl.hasError('maxlength')" class="cut-text">
The password can not be longer than 25 characters.
</mat-error>

</mat-form-field>

<ngx-material-password-strength
[password]="signUpFormGroup.value.password"
[externalError]="sigUpPasswordFormControl.dirty">
</ngx-material-password-strength>

</div>

<button mat-raised-button
style="margin-top: 20px"
type="submit"
[color]="color">
Register
</button>

</div>
</form>

<button mat-button
style="margin-top: 20px"
[color]="color"
(click)="authProcess.signInWith(authProvider.ANONYMOUS)">
<mat-icon>fingerprint</mat-icon>
continue as guest
</button>

</mat-card-content>
<mat-card-footer *ngIf="authProcess.isLoading">
<mat-progress-bar mode="indeterminate"></mat-progress-bar>
Expand Down
1 change: 1 addition & 0 deletions src/module/components/auth/auth.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export class AuthComponent implements OnInit, OnDestroy {
@Output()
onError: any;

authProvider = AuthProvider;
passwordResetWished: any;

public signInFormGroup: FormGroup;
Expand Down

0 comments on commit f8f65cb

Please sign in to comment.