This project was generated with Angular CLI version 8.3.19.
- Open Firebase Console
- Create a new Project
- Navigate to Authentication / Sign-in method
- Enable Google provider (only)
ng new fbauth
cd fbauth
npm install @angular/fire firebase --save
ng generate service services/auth
ng generate component components/index
ng generate component components/user-profile
ng generate guard guards/auth
- edit
app.module.ts
to initialize firebase settings - edit
app-routing.module.ts
to add routing rules - edit
user-profile.component.ts
anduser-profile.component.html
to setup Google login - edit
auth.guard.ts
to implement permission check for routes
Google authentication handles only the login process.
You can restrict access (authorization) only by Firebase access rules: Firebase Console / Database / Rules .