Skip to content

Commit 06a64a7

Browse files
init
1 parent eed3763 commit 06a64a7

8 files changed

+1049
-270
lines changed

package-lock.json

+991-248
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+4
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,16 @@
1515
"@angular/common": "~7.0.0",
1616
"@angular/compiler": "~7.0.0",
1717
"@angular/core": "~7.0.0",
18+
"@angular/fire": "^5.1.0",
1819
"@angular/forms": "~7.0.0",
1920
"@angular/http": "~7.0.0",
2021
"@angular/platform-browser": "~7.0.0",
2122
"@angular/platform-browser-dynamic": "~7.0.0",
2223
"@angular/router": "~7.0.0",
2324
"core-js": "^2.5.4",
25+
"firebase": "^5.5.8",
26+
"firebaseui": "^3.4.1",
27+
"firebaseui-angular": "^3.3.2",
2428
"rxjs": "~6.3.3",
2529
"zone.js": "~0.8.26"
2630
},

src/app/app.component.html

+6-19
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,7 @@
1-
<!--The content below is only a placeholder and can be replaced.-->
2-
<div style="text-align:center">
3-
<h1>
4-
Welcome to {{ title }}!
5-
</h1>
6-
<img width="300" alt="Angular Logo" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg==">
1+
<div *ngIf="afAuth.auth.currentUser">
2+
<h1>Logged In</h1>
73
</div>
8-
<h2>Here are some links to help you start: </h2>
9-
<ul>
10-
<li>
11-
<h2><a target="_blank" rel="noopener" href="https://angular.io/tutorial">Tour of Heroes</a></h2>
12-
</li>
13-
<li>
14-
<h2><a target="_blank" rel="noopener" href="https://github.com/angular/angular-cli/wiki">CLI Documentation</a></h2>
15-
</li>
16-
<li>
17-
<h2><a target="_blank" rel="noopener" href="https://blog.angular.io/">Angular blog</a></h2>
18-
</li>
19-
</ul>
20-
4+
<div *ngIf="!afAuth.auth.currentUser">
5+
<h1>Logged Out</h1>
6+
<firebase-ui></firebase-ui>
7+
</div>

src/app/app.component.ts

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Component } from '@angular/core';
2+
import { AngularFireAuth } from '@angular/fire/auth';
23

34
@Component({
45
selector: 'app-root',
@@ -7,4 +8,8 @@ import { Component } from '@angular/core';
78
})
89
export class AppComponent {
910
title = 'auth';
11+
12+
constructor(public afAuth: AngularFireAuth) {
13+
14+
}
1015
}

src/app/app.module.ts

+23-1
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,34 @@ import { NgModule } from '@angular/core';
33

44
import { AppComponent } from './app.component';
55

6+
import {FirebaseUIModule, firebase, firebaseui} from 'firebaseui-angular';
7+
8+
import {AngularFireModule} from '@angular/fire';
9+
import {AngularFireAuthModule} from '@angular/fire/auth';
10+
import { environment } from 'src/environments/environment.prod';
11+
12+
const firebaseUiAuthConfig: firebaseui.auth.Config = {
13+
signInFlow: 'popup',
14+
signInOptions: [
15+
{
16+
requireDisplayName: false,
17+
provider: firebase.auth.EmailAuthProvider.PROVIDER_ID
18+
},
19+
],
20+
// tosUrl: '<your-tos-link>',
21+
// privacyPolicyUrl: '<your-privacyPolicyUrl-link>',
22+
credentialHelper: firebaseui.auth.CredentialHelper.NONE
23+
};
24+
625
@NgModule({
726
declarations: [
827
AppComponent
928
],
1029
imports: [
11-
BrowserModule
30+
BrowserModule,
31+
AngularFireModule.initializeApp(environment.firebaseConfig),
32+
AngularFireAuthModule,
33+
FirebaseUIModule.forRoot(firebaseUiAuthConfig)
1234
],
1335
providers: [],
1436
bootstrap: [AppComponent]

src/environments/environment.prod.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
export const environment = {
2-
production: true
2+
production: true,
3+
firebaseConfig: {
4+
apiKey: "AIzaSyAPLBlBVpF7wzLJXlXWOTpXNOJ-ZlEcAWE",
5+
authDomain: "auth-f770a.firebaseapp.com",
6+
databaseURL: "https://auth-f770a.firebaseio.com",
7+
projectId: "auth-f770a",
8+
storageBucket: "",
9+
messagingSenderId: "210018507265"
10+
}
311
};

src/environments/environment.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,15 @@
33
// The list of file replacements can be found in `angular.json`.
44

55
export const environment = {
6-
production: false
6+
production: false,
7+
firebaseConfig: {
8+
apiKey: "AIzaSyAPLBlBVpF7wzLJXlXWOTpXNOJ-ZlEcAWE",
9+
authDomain: "auth-f770a.firebaseapp.com",
10+
databaseURL: "https://auth-f770a.firebaseio.com",
11+
projectId: "auth-f770a",
12+
storageBucket: "",
13+
messagingSenderId: "210018507265"
14+
}
715
};
816

917
/*

src/styles.scss

+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
/* You can add global styles to this file, and also import other style files */
2+
3+
@import '~firebaseui/dist/firebaseui.css';

0 commit comments

Comments
 (0)