-
-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(package): added authGuardLoggedInURL to the config #263
- Loading branch information
1 parent
17a6b0e
commit 0abbcdb
Showing
16 changed files
with
268 additions
and
8 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
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
45 changes: 45 additions & 0 deletions
45
demo/src/app/examples/guards-example/guards-example.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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<div class="jumbotron jumbotron-fluid"> | ||
<div class="container"> | ||
<h1>Password Strength API - Config</h1> | ||
</div> | ||
</div> | ||
|
||
|
||
<div class="container"> | ||
|
||
<div fxLayout="row wrap" fxLayout.xs="column" fxLayoutAlign="center"> | ||
|
||
<mat-card fxFlexAlign.gt-xs="center"> | ||
<mat-card-subtitle> | ||
<div fxLayout="row" fxLayoutAlign="space-between"> | ||
<pre><code [highlight]="example"></code></pre> | ||
<button mat-icon-button | ||
ngxClipboard | ||
[cbContent]="example" | ||
matTooltip="copy" | ||
(click)="showCopyMessage(example)"> | ||
<mat-icon aria-label="copy content" class="mat-18">content_copy</mat-icon> | ||
</button> | ||
</div> | ||
</mat-card-subtitle> | ||
<mat-card-content> | ||
<ngx-auth-firebaseui tabIndex="1" | ||
[min]="8" | ||
[max]="15" | ||
[enableLengthRule]="true" | ||
[enableLowerCaseLetterRule]="true" | ||
[enableUpperCaseLetterRule]="true" | ||
[enableDigitRule]="true" | ||
[enableSpecialCharRule]="true" | ||
(onStrengthChanged)="onStrengthChanged($event)"> | ||
</ngx-auth-firebaseui> | ||
</mat-card-content> | ||
</mat-card> | ||
</div> | ||
</div> | ||
|
||
|
||
|
||
|
||
|
||
|
Empty file.
31 changes: 31 additions & 0 deletions
31
demo/src/app/examples/guards-example/guards-example.component.ts
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,31 @@ | ||
import {Component} from '@angular/core'; | ||
import {MatSnackBar} from '@angular/material/snack-bar'; | ||
import {ExampleBaseComponent} from '../example.abstract'; | ||
|
||
@Component({ | ||
selector: 'app-password-strength', | ||
templateUrl: 'guards-example.component.html', | ||
styleUrls: ['guards-example.component.scss'] | ||
}) | ||
export class GuardsExampleComponent extends ExampleBaseComponent { | ||
|
||
example = `<ngx-auth-firebaseui tabIndex="1" | ||
[min]="8" | ||
[max]="15" | ||
[enableLengthRule]="true" | ||
[enableLowerCaseLetterRule]="true" | ||
[enableUpperCaseLetterRule]="true" | ||
[enableDigitRule]="true" | ||
[enableSpecialCharRule]="true" | ||
(onStrengthChanged)="onStrengthChanged($event)"> | ||
</ngx-auth-firebaseui>`; | ||
|
||
constructor(public snackBar: MatSnackBar) { | ||
super(snackBar); | ||
} | ||
|
||
onStrengthChanged($event: number) { | ||
console.log('on strength changed: ', $event); | ||
} | ||
|
||
} |
54 changes: 54 additions & 0 deletions
54
demo/src/app/examples/guards-example/logged-in/logged-in.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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<div class="jumbotron jumbotron-fluid"> | ||
<div class="container"> | ||
<h1>Yes!! you are logged in! Congrats</h1> | ||
</div> | ||
</div> | ||
|
||
|
||
<div class="container"> | ||
|
||
<div fxLayout="row wrap" fxLayout.xs="column" fxLayoutAlign="center"> | ||
|
||
<mat-card fxFlexAlign.gt-xs="center"> | ||
<mat-card-title>add authGuardFallbackURL and authGuardLoggedInURL to the NgxAuthFirebaseUIModule</mat-card-title> | ||
<mat-card-subtitle> | ||
<div fxLayout="row" fxLayoutAlign="space-between"> | ||
<pre><code [highlight]="example"></code></pre> | ||
<button mat-icon-button | ||
ngxClipboard | ||
[cbContent]="example" | ||
matTooltip="copy" | ||
(click)="showCopyMessage(example)"> | ||
<mat-icon aria-label="copy content" class="mat-18">content_copy</mat-icon> | ||
</button> | ||
</div> | ||
</mat-card-subtitle> | ||
</mat-card> | ||
|
||
<mat-card class="my-4" fxFlexAlign.gt-xs="center"> | ||
<mat-card-title>use the canActivate feature on your route</mat-card-title> | ||
<mat-card-subtitle> | ||
<div fxLayout="row" fxLayoutAlign="space-between"> | ||
<pre><code [highlight]="example2"></code></pre> | ||
<button mat-icon-button | ||
ngxClipboard | ||
[cbContent]="example2" | ||
matTooltip="copy" | ||
(click)="showCopyMessage(example2)"> | ||
<mat-icon aria-label="copy content" class="mat-18">content_copy</mat-icon> | ||
</button> | ||
</div> | ||
</mat-card-subtitle> | ||
<mat-card-content> | ||
<ngx-auth-firebaseui-user> | ||
</ngx-auth-firebaseui-user> | ||
</mat-card-content> | ||
</mat-card> | ||
</div> | ||
</div> | ||
|
||
|
||
|
||
|
||
|
||
|
Empty file.
35 changes: 35 additions & 0 deletions
35
demo/src/app/examples/guards-example/logged-in/logged-in.component.ts
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,35 @@ | ||
import {Component} from '@angular/core'; | ||
import {MatSnackBar} from '@angular/material/snack-bar'; | ||
import {ExampleBaseComponent} from '../../example.abstract'; | ||
|
||
@Component({ | ||
selector: 'app-logged-in', | ||
templateUrl: 'logged-in.component.html', | ||
styleUrls: ['logged-in.component.scss'] | ||
}) | ||
export class LoggedInComponent extends ExampleBaseComponent { | ||
|
||
example = ` | ||
import {NgxAuthFirebaseUIModule} from 'ngx-auth-firebaseui'; | ||
NgxAuthFirebaseUIModule.forRoot(firebaseKey, firebaseAppNameFactory, | ||
{ | ||
authGuardFallbackURL: 'examples/logged-out', | ||
authGuardLoggedInURL: 'examples/logged-in', | ||
}),`; | ||
|
||
example2 = ` | ||
import {LoggedInGuard} from 'ngx-auth-firebaseui'; | ||
{path: 'guards', component: GuardsExampleComponent, canActivate : [LoggedInGuard]},`; | ||
|
||
constructor(public snackBar: MatSnackBar) { | ||
super(snackBar); | ||
} | ||
|
||
onStrengthChanged($event: number) { | ||
console.log('on strength changed: ', $event); | ||
} | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
demo/src/app/examples/guards-example/logged-out/logged-out.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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<div class="jumbotron jumbotron-fluid"> | ||
<div class="container"> | ||
<h1>Sorry!! You are logged out</h1> | ||
</div> | ||
</div> | ||
|
||
|
||
<div class="container"> | ||
|
||
<div fxLayout="row wrap" fxLayout.xs="column" fxLayoutAlign="center"> | ||
|
||
<mat-card fxFlexAlign.gt-xs="center"> | ||
<mat-card-title>Please log in</mat-card-title> | ||
<mat-card-content> | ||
<ngx-auth-firebaseui> | ||
</ngx-auth-firebaseui> | ||
</mat-card-content> | ||
</mat-card> | ||
</div> | ||
</div> | ||
|
||
|
||
|
||
|
||
|
||
|
Empty file.
31 changes: 31 additions & 0 deletions
31
demo/src/app/examples/guards-example/logged-out/logged-out.component.ts
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,31 @@ | ||
import {Component} from '@angular/core'; | ||
import {MatSnackBar} from '@angular/material/snack-bar'; | ||
import {ExampleBaseComponent} from '../../example.abstract'; | ||
|
||
@Component({ | ||
selector: 'app-logged-out', | ||
templateUrl: 'logged-out.component.html', | ||
styleUrls: ['logged-out.component.scss'] | ||
}) | ||
export class LoggedOutComponent extends ExampleBaseComponent { | ||
|
||
example = `<ngx-auth-firebaseui tabIndex="1" | ||
[min]="8" | ||
[max]="15" | ||
[enableLengthRule]="true" | ||
[enableLowerCaseLetterRule]="true" | ||
[enableUpperCaseLetterRule]="true" | ||
[enableDigitRule]="true" | ||
[enableSpecialCharRule]="true" | ||
(onStrengthChanged)="onStrengthChanged($event)"> | ||
</ngx-auth-firebaseui>`; | ||
|
||
constructor(public snackBar: MatSnackBar) { | ||
super(snackBar); | ||
} | ||
|
||
onStrengthChanged($event: number) { | ||
console.log('on strength changed: ', $event); | ||
} | ||
|
||
} |
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