...

/

Exercise 11: Real-time Database!

Exercise 11: Real-time Database!

We will run and verify our app after adding the Real-time database.

We'll cover the following...

Project

import React from 'react';

import { AuthUserContext } from '../Session';
import { PasswordForgetForm } from '../PasswordForget';
import PasswordChangeForm from '../PasswordChange';
import { withAuthorization } from '../Session';

const AccountPage = () => (
  <AuthUserContext.Consumer>
    {authUser => (
      <div>
        <h1>Account: {authUser.email}</h1>
        <PasswordForgetForm />
        <PasswordChangeForm />
      </div>
    )}
  </AuthUserContext.Consumer>
);

const authCondition = authUser => !!authUser;

export default withAuthorization(authCondition)(AccountPage);

We’ve implemented the Real-time Database interface in src/components/Firebase/firebase.js as we did for the authentication API. ...