Skip to content

Component to provide Firebase Auth #24

@sampl

Description

@sampl

I know this isn't a Firestore request, but I'm guessing a lot of people who use this package would appreciate a component with a similar API to expose the state of Firebase Auth. (I know I would.)

Sample usage:

import { FirebaseAuth } from 'react-firestore'

<FirebaseAuth>
  { ({error, isLoading, auth}) => {
    if (error) {
      return 'error logging you in'
    }
    if (isLoading) {
      return 'loading account...'
    }
    if (!auth) {
      return <LoginButton />
    } else {
      return <UserSummary user={auth} />
    }
  }}
</FirebaseAuth>

Something like this could work: https://github.com/sampl/firefly/blob/master/src/data/AuthProvider.js

What do you think @green-arrow?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions