Creating a login form with React for authentication

As we have done with the authentication configuration for Firebase and Facebook and enabled the features for other providers, now we'll create a login form in react to secure the application that always validates whether the user logged in or not; it will redirect the user to the login page. So let's create a login page and also configure the React routing to redirect he user based on the path URL.

Open firebase-config.js from the firebase folder and export the following objects with different providers so that we can access those objects across the application:

export const firebaseApp = firebase.initializeApp(config);export const googleProvider = new firebase.auth.GoogleAuthProvider

Get Serverless Web Applications with React and Firebase now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.