Git Product home page Git Product logo

armand1m / react-with-firebase-auth Goto Github PK

View Code? Open in Web Editor NEW
129.0 3.0 31.0 11.04 MB

Higher-Order Component for integrating Firebase Authentication methods with a React Component through props

Home Page: https://armand1m.github.io/react-with-firebase-auth/

License: MIT License

HTML 6.74% JavaScript 2.58% TypeScript 90.59% Shell 0.10%
react firebase higher-order-component authentication firebase-auth

react-with-firebase-auth's Introduction

react-with-firebase-auth

NPM JavaScript Style Guide Build Status codecov bundlephobia bundlephobia devdependencies peerdependencies Greenkeeper badge

Higher Order Component for integrating Firebase with a React Component

This library makes a withFirebaseAuth() function available to you.

Signature

type FirebaseAuthProps = {
  firebaseAppAuth: firebase.auth.Auth,
  providers?: {
    googleProvider?: firebase.auth.GoogleAuthProvider_Instance;
    facebookProvider?: firebase.auth.FacebookAuthProvider_Instance;
    twitterProvider?: firebase.auth.TwitterAuthProvider_Instance;
    githubProvider?:  firebase.auth.GithubAuthProvider_Instance;
  }
};

withFirebaseAuth<P>(authProps: FirebaseAuthProps) =>
  createComponentWithAuth(WrappedComponent: React.ComponentType<P>) =>
    React.ComponentType

Props Provided

type WrappedComponentProps = {
  signInWithEmailAndPassword: (email: string, password: string) => void;
  createUserWithEmailAndPassword: (email: string, password: string) => void;
  signInWithGoogle: () => void;
  signInWithFacebook: () => void;
  signInWithGithub: () => void;
  signInWithTwitter: () => void;
  signInWithPhoneNumber: (
    phoneNumber: string,
    applicationVerifier: firebase.auth.ApplicationVerifier,
  ) => void;
  signInAnonymously: () => void;
  signOut: () => void;
  setError: (error: string) => void;
  user?: firebase.User | null;
  error?: string;
  loading: boolean;
};

Usage

Install it:

npm install --save react-with-firebase-auth

Then use it in your components:

import * as React from 'react';
import * as firebase from 'firebase/app';
import 'firebase/auth';

import withFirebaseAuth, { WrappedComponentProps } from 'react-with-firebase-auth';

import firebaseConfig from './firebaseConfig';

const firebaseApp = firebase.initializeApp(firebaseConfig);

const firebaseAppAuth = firebaseApp.auth();

/** See the signature above to find out the available providers */
const providers = {
  googleProvider: new firebase.auth.GoogleAuthProvider(),
};

/** providers can be customised as per the Firebase documentation on auth providers **/
providers.googleProvider.setCustomParameters({
  hd: 'mycompany.com',
});

/** Create the FirebaseAuth component wrapper */
const createComponentWithAuth = withFirebaseAuth({
  providers,
  firebaseAppAuth,
});

const App = ({
  /** These props are provided by withFirebaseAuth HOC */
  signInWithEmailAndPassword,
  createUserWithEmailAndPassword,
  signInWithGoogle,
  signInWithFacebook,
  signInWithGithub,
  signInWithTwitter,
  signInAnonymously,
  signOut,
  setError,
  user,
  error,
  loading,
}: WrappedComponentProps) => (
  <React.Fragment>
    {
      user
        ? <h1>Hello, {user.displayName}</h1>
        : <h1>Log in</h1>
    }

    {
      user
        ? <button onClick={signOut}>Sign out</button>
        : <button onClick={signInWithGoogle}>Sign in with Google</button>
    }

    {
      loading && <h2>Loading..</h2>
    }
  </React.Fragment>
);

/** Wrap it */
export default createComponentWithAuth(App);

Examples

There are a few source code examples available:

You can also check a live demo example here:

Articles

Stargazers

Stargazers over time

License

MIT Β© Armando Magalhaes

react-with-firebase-auth's People

Contributors

0xabrar avatar armand1m avatar dependabot[bot] avatar greenkeeper[bot] avatar k-sato1995 avatar mxkxf avatar projectint avatar pvssvikas avatar semantic-release-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

react-with-firebase-auth's Issues

Email verification

How to implement email verification upon registration?

and how about forget password?

An in-range update of ts-jest is breaking the build 🚨


☝️ Important announcement: Greenkeeper will be saying goodbye πŸ‘‹ and passing the torch to Snyk on June 3rd, 2020! Find out how to migrate to Snyk and more at greenkeeper.io


The devDependency ts-jest was updated from 25.3.1 to 25.4.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

ts-jest is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ Build: Your Google Cloud Platform project is not set up correctly for this GitHub app. Please go through the setup flow again in the cloud console.

Commits

The new version differs by 34 commits.

  • d6472a3 Merge branch 'master' of github.com:kulshekhar/ts-jest
  • 36e1b32 chore(release): 25.4.0
  • 346d362 chore: correct set debug log in Bug/Regression template (#1534)
  • 85f95e8 chore: update package-lock.json
  • 1b374d8 build(deps): bump yargs-parser from 18.1.2 to 18.1.3 (#1531)
  • 8ad8822 chore (BREAKING): require minimum typescript@3.4 (#1530)
  • aa6b74c fix(compiler): make projectReferences work with isolatedModules: true (#1527)
  • 6c0b75d build(deps): bump resolve from 1.15.1 to 1.16.0 (#1528)
  • b3c55d6 chore: upgrade dependencies, correct typings (#1524)
  • 19c32a2 docs: add github action to generate doc (#1522)
  • 232c458 chore(e2e): add nrwl-nx to e2e external test cases (#1519)
  • 406a4cf Merge pull request #1521 from kulshekhar/dependabot/npm_and_yarn/types/react-16.9.34
  • 422699a build(deps-dev): bump @types/react from 16.9.33 to 16.9.34
  • 3abbdca build(deps-dev): bump lint-staged from 10.1.2 to 10.1.3 (#1520)
  • fcac096 Merge pull request #1518 from kulshekhar/dependabot/npm_and_yarn/types/react-16.9.33

There are 34 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

No error returned if signInWithEmailAndPassword is used with bad email or password

Describe the bug
I tried to use signInWithEmailAndPassword with emails that were not registered in my Google Identity Platform or emails that were registered but with wrong password. I can see an error 400 in the network developer tool but the error object remains empty.

To Reproduce
Setup a new react project with firebase and react-with-firebase-auth, as well as in your google cloud console + firebase console.
In Google Identity Platform, create a test user.
Use signInWithEmailAndPassword with a random email.
Use signInWithEmailAndPassword with your test email but a raondom password.
If you console.log the error, it is still undefined.

Expected behavior
error object shall tell me either "Wrong email" or "Wrong password"

Desktop (please complete the following information):

  • OS: Ubuntu 18.04
  • Browser Firefox
  • Version: 69.0.3-1

Thanks !!

An in-range update of rollup-plugin-typescript2 is breaking the build 🚨


🚨 Reminder! Less than one month left to migrate your repositories over to Snyk before Greenkeeper says goodbye on June 3rd! πŸ’œ πŸššπŸ’¨ πŸ’š

Find out how to migrate to Snyk at greenkeeper.io


The devDependency rollup-plugin-typescript2 was updated from 0.27.0 to 0.27.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

rollup-plugin-typescript2 is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ Build: Your Google Cloud Platform project is not set up correctly for this GitHub app. Please go through the setup flow again in the cloud console.

Commits

The new version differs by 10 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @types/react is breaking the build 🚨


🚨 Reminder! Less than one month left to migrate your repositories over to Snyk before Greenkeeper says goodbye on June 3rd! πŸ’œ πŸššπŸ’¨ πŸ’š

Find out how to migrate to Snyk at greenkeeper.io


The devDependency @types/react was updated from 16.9.34 to 16.9.35.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/react is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ Build: Your Google Cloud Platform project is not set up correctly for this GitHub app. Please go through the setup flow again in the cloud console.

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of codecov is breaking the build 🚨


🚨 Reminder! Less than one month left to migrate your repositories over to Snyk before Greenkeeper says goodbye on June 3rd! πŸ’œ πŸššπŸ’¨ πŸ’š

Find out how to migrate to Snyk at greenkeeper.io


The devDependency codecov was updated from 3.6.5 to 3.7.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

codecov is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ Build: Your Google Cloud Platform project is not set up correctly for this GitHub app. Please go through the setup flow again in the cloud console.

Commits

The new version differs by 11 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of rollup is breaking the build 🚨

The devDependency rollup was updated from 1.9.2 to 1.9.3.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

rollup is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v1.9.3

2019-04-10

Bug Fixes

  • Simplify return expressions that are evaluated before the surrounding function is bound (#2803)

Pull Requests

  • #2803: Handle out-of-order binding of identifiers to improve tree-shaking (@lukastaegert)
Commits

The new version differs by 3 commits.

  • 516a06d 1.9.3
  • a5526ea Update changelog
  • c3d73ff Handle out-of-order binding of identifiers to improve tree-shaking (#2803)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

If `/` is a Private Route, you are redirected to `/login` before XHR returns from firebase. Suggestions? [Solved]

I was able to make this (sort of) work with a Router. The Router is within App.js which I wrap in the withFirebaseAuth HOC.

/ is a private, it redirects automatically to /login if a user hasn't logged in yet

If the user had logged in before, the user automatically logs in but the user has already been redirected because the response has taken longer than to check if user exists.

import React, { Component } from 'react';
import { connect } from 'react-redux'
import { bindActionCreators, compose } from 'redux'
import { Route, Redirect, Switch, withRouter } from 'react-router-dom'
import withFirebaseAuth from 'react-with-firebase-auth';
import * as firebase from "firebase/app";
import "firebase/auth";

import firebaseConfig from './constants/firebaseConfig';

import ViewList from './components/ViewList'
import ViewLogin from './components/ViewLogin'

import styles from './App.module.scss'

const firebaseApp = firebase.initializeApp(firebaseConfig);
const firebaseAppAuth = firebaseApp.auth();

const PrivateRoute = ({
  children,
  user,
  location,
}) => {
  console.log( 'private route', user)
  if ( user ) {
    return children
  } else {
    return (
      <Redirect to={{
        pathname: '/login',
        state: { from: location }
      }} />
    )
  }
}

/**
 * @class App
 * @extends {Component}
 */
class App extends Component {
  
  render() {
    const { 
      location,
    } = this.props
    return (
      <React.Fragment>
        <Switch location={location}>
            <Route exact
                path={`/`}
                render={
                    () => (
                        <PrivateRoute {...this.props}>
                            <ViewList {...this.props} />
                        </PrivateRoute>
                    )
                }
            />
            <Route exact
                path={`/login`}
                render={
                    () => (
                        <ViewLogin {...this.props} />
                    )
                }
            />
        </Switch>
      </React.Fragment>
    );
  }
}

const mapStateToProps = state => ({
})

const mapDispatchToProps = ( dispatch ) => bindActionCreators({
}, dispatch )

export default compose(
  withRouter, // https://stackoverflow.com/questions/46485056/withrouter-connect-and-react-compose
  // withRouter needs to come first in order for history state to work properly https://github.com/supasate/connected-react-router/issues/130#issuecomment-428221018
  withFirebaseAuth({
    firebaseAppAuth
  }),
  connect(
    mapStateToProps,
    mapDispatchToProps
  ),
)(App)

signIn Promises

Were Promises removed from 1.3.0 to 1.3.2? The below code works for me in 1.3.0, but throws the error "signInWithGoogle is undefined" in 1.3.2 (but without the .then throws no error).

signInWithGoogle().then(res => handleSignIn(res));

Either ways, it signs in with the Provider, just doesn't execute handleSignIn in 1.3.2

An in-range update of semantic-release is breaking the build 🚨


☝️ Important announcement: Greenkeeper will be saying goodbye πŸ‘‹ and passing the torch to Snyk on June 3rd, 2020! Find out how to migrate to Snyk and more at greenkeeper.io


The devDependency semantic-release was updated from 17.0.4 to 17.0.5.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

semantic-release is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ Build: Your Google Cloud Platform project is not set up correctly for this GitHub app. Please go through the setup flow again in the cloud console.

Release Notes for v17.0.5

17.0.5 (2020-04-16)

Bug Fixes

  • adapt for semver to version 7.3.2 (0363790)
Commits

The new version differs by 11 commits.

  • 0363790 fix: adapt for semver to version 7.3.2
  • 93cb766 chore(package): update semver to version 7.3.2
  • caa3526 style: xo
  • ed5f26d chore(package): update xo to version 0.29.0
  • ff1d53d docs: add @google/semantic-release-replace-plugin to plugin list (#1509)
  • f899fa9 chore(package): update xo to version 0.28.1
  • b5488ae chore(package): update fs-extra to version 9.0.0
  • da5d1cf chore(package): update tempy to version 0.5.0
  • da5d06c docs: fix formatting for GitBook
  • b85adbd chore(package): update xo to version 0.27.0
  • bce633a chore(package): update sinon to version 9.0.0

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

[WIP] Release: v2.0.0 - Hooks based API

Context

This library is already almost 2 years old. There is a lot of people who come to this as an easy way out to set up firebase authentication in react applications since it aims to be very straightforward, and I'd say it achieves the goal well.

Yet, I'm not completely happy with the current Higher Order Function design, and I feel like the current API offering static implementations of authentication methods creates a sort of vendor lock-in to this library, which I don't appreciate and feel like we could offer something more flexible instead.

Proposal

First: a Hooks based API.

Most folks that come to use this library want to just have it managing the state regarding firebase authentication and ease to just hook firebase.auth() into a component and have methods ready to go.

The very same experience could be given through a useFirebaseAuth() hook.

(more details to come)

googleProvider?: firebase.auth.GithubAuthProvider_Instance; typo or intentionally coded?

https://github.com/armand1m/react-with-firebase-auth#signature

type HocParameters = {
  firebaseAppAuth: firebase.auth.Auth,
  providers?: {
    googleProvider?: firebase.auth.GithubAuthProvider_Instance;
    facebookProvider?: firebase.auth.FacebookAuthProvider_Instance;
    twitterProvider?: firebase.auth.TwitterAuthProvider_Instance;
    githubProvider?:  firebase.auth.GithubAuthProvider_Instance;
  }
};

withFirebaseAuth(props: HocParameters): HigherOrderComponent

is the "GithubAuthProvider_Instance" after googleProvider intentionally coded or typo?
shouldn't it be

type HocParameters = {
  firebaseAppAuth: firebase.auth.Auth,
  providers?: {
                            // this v
    googleProvider?: firebase.auth.GoogleAuthProvider_Instance;
    facebookProvider?: firebase.auth.FacebookAuthProvider_Instance;
    twitterProvider?: firebase.auth.TwitterAuthProvider_Instance;
    githubProvider?:  firebase.auth.GithubAuthProvider_Instance;
  }
};

withFirebaseAuth(props: HocParameters): HigherOrderComponent

An in-range update of @types/react-dom is breaking the build 🚨


☝️ Important announcement: Greenkeeper will be saying goodbye πŸ‘‹ and passing the torch to Snyk on June 3rd, 2020! Find out how to migrate to Snyk and more at greenkeeper.io


The devDependency @types/react-dom was updated from 16.9.6 to 16.9.7.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/react-dom is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ Build: Your Google Cloud Platform project is not set up correctly for this GitHub app. Please go through the setup flow again in the cloud console.

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Loading is true by default

Case 1
After the component mounts, and before any action is taken then loading is set to true.
It's set to false only after a successful attempt to login.

Case 2
After the component mounts, if the user is already logged in then loading is set to true. It remains true forever.

Expected behavior
loading is set to true only when a login operation is being performed.

An in-range update of firebase is breaking the build 🚨


☝️ Important announcement: Greenkeeper will be saying goodbye πŸ‘‹ and passing the torch to Snyk on June 3rd, 2020! Find out how to migrate to Snyk and more at greenkeeper.io


The dependency firebase was updated from 7.14.0 to 7.14.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

firebase is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ Build: Your Google Cloud Platform project is not set up correctly for this GitHub app. Please go through the setup flow again in the cloud console.

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Invalid npm token.

The npm token configured in the NPM_TOKEN environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/.

If you are using Two-Factor Authentication, make configure the auth-only level is supported. semantic-release cannot publish with the default auth-and-writes level.

Please make sure to set the NPM_TOKEN environment variable in your CI with the exact value of the npm token.


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

It seems that there is no token specified for user

Describe the bug
I want to auth with Firebase and then use token - to store and retrieve data from firebase for authenticated users.
It seems that user object does not contain token.

To Reproduce
Steps to reproduce the behavior:

  1. Auth via Google or Email-password
  2. Check user object returned
  3. There is no token

Expected behavior
Token property is shown there

There is a workaround - to useEffect() for user change. Then add property to the user with
firebase.auth().currentUser.getIdToken(/* forceRefresh */ true).then(function(idToken) {
// Send token to your backend via HTTPS
// ...
}).catch(function(error) {
// Handle error
});

Issues with in-app browsers (signInWithPopup).

Is your feature request related to a problem? Please describe.
Currently, this package only allows the use of signInWithPopup. This causes issues with users that are browsing a website in an in-app browser (like Instagram).

Describe the solution you'd like
Add a flag to choose between signInWithPopup and signInWithRedirect

Additional context
Related issue in firebase

signInWithEmailAndPassword return undefined

Describe the bug
signInWithEmailAndPassword = (email: string, password: string) => { this.tryTo<firebase.auth.UserCredential>(() => firebaseAppAuth.signInWithEmailAndPassword(email, password), ); };
signInWithEmailAndPassword return undefined

To Reproduce
Steps to reproduce the behavior:
Try to catch the error. (in props only message string)

Expected behavior
signInWithEmailAndPassword(l.p).catch(error => console.log('error', error))

Additional context
This behavior is not convenient for internationalization. How to translate the error messages?
In your source looks like you wanted to return error object, and pass a message to props, but have bug.

An in-range update of @types/jest is breaking the build 🚨

The devDependency @types/jest was updated from 25.1.1 to 25.1.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/jest is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

signInWithFacebook not working!

I destructed {signInWithGoogle, signInWithFacebook} from withFirebaseAuth -> just like in the tutorial.

the googleLogin works just perfects. but the facebook login return null all the time!

i already configued the Facebook Developer App with the redirect URI from the Firebase Facebook login configuration.

i guess it's a problem with the method signInWithFacebook.
does anyone else confront it?

import React, { Component } from 'react';
import { BrowserRouter, Route, Switch} from 'react-router-dom';
import Login  from  './components/Login';
import Gulo   from  './components/Gulo';

import withFirebaseAuth from 'react-with-firebase-auth'
import * as firebase from 'firebase/app';
import 'firebase/auth';
import firebaseConfig from './firebaseConfig';
const firebaseApp = firebase.initializeApp(firebaseConfig);
const firebaseAppAuth = firebaseApp.auth();
const providers = {
  googleProvider:   new firebase.auth.GoogleAuthProvider(),
  facebookProvider: firebase.auth.FacebookAuthProvider()
};


class Router extends Component {
  render() {
    let {signInWithGoogle, signInWithFacebook, signOut} = this.props;
    return (
      <BrowserRouter>
        <Switch>
            {/*<Route path="/Login" component={Login}></Route>*/}
            <Route path="/Login"
              render={(routeProps) => (
                <Login {...routeProps} login={{google: signInWithGoogle, facebook: signInWithFacebook, signOut}} />
              )}
            />
            <Route path="/" component={Gulo}></Route>
        </Switch>
      </BrowserRouter>
    );
  }
}

export default withFirebaseAuth({
  providers,
  firebaseAppAuth,
})(Router);

Router.js

the Login.js only calls:
this.props.login.google() | this.props.login.facebook()
in their connect buttons.

please help me!

An in-range update of prettier is breaking the build 🚨


☝️ Important announcement: Greenkeeper will be saying goodbye πŸ‘‹ and passing the torch to Snyk on June 3rd, 2020! Find out how to migrate to Snyk and more at greenkeeper.io


The devDependency prettier was updated from 2.0.4 to 2.0.5.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

prettier is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ Build: Your Google Cloud Platform project is not set up correctly for this GitHub app. Please go through the setup flow again in the cloud console.

Release Notes for 2.0.5

πŸ”— Changelog

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of babel7 is breaking the build 🚨


🚨 Reminder! Less than one month left to migrate your repositories over to Snyk before Greenkeeper says goodbye on June 3rd! πŸ’œ πŸššπŸ’¨ πŸ’š

Find out how to migrate to Snyk at greenkeeper.io


There have been updates to the babel7 monorepo:

    • The devDependency @babel/core was updated from 7.9.6 to 7.10.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the babel7 group definition.

babel7 is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ Build: Your Google Cloud Platform project is not set up correctly for this GitHub app. Please go through the setup flow again in the cloud console.

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Expose loading state

First of all, thanks for making this!

I have it set up and working however I get a few seconds of showing the "sign up" button before the user gets populated and then I show a different component to logged in users.

It would be great if there was (like error) there was a loading which could be used to determine if data fetching is happening in the background, rather than having the 2 binary logged in/logged out states.

If this is already possible using a combination of the existing state then I'd really appreciate an example.

Cheers!

Mostly a thank you, also seems to need Typescript's strict turned off

First and foremost, thanks. I only wish I'd discovered this before trying to merge in the code from https://github.com/the-road-to-react-with-firebase into my app.

It wasn't immediately obvious to me how to make this work in Typescript. I eventually got it working with this import:
import withFirebaseAuth, { WrappedComponentProps } from 'react-with-firebase-auth'
And then by declaring my app like so:
const App = ({ user, error, loading, setError, signOut, signInAnonymously, signInWithEmailAndPassword, signInWithGoogle, signInWithGithub, createUserWithEmailAndPassword, }: WrappedComponentProps) => {
A very small thing though: your sample code makes this call setError(null) and that won't compile unless I set Typescript's strict flag to false. Can you consider changing the definition to setError: (error: string | null) => void;?

I could open a PR for this.

An in-range update of rollup is breaking the build 🚨


☝️ Important announcement: Greenkeeper will be saying goodbye πŸ‘‹ and passing the torch to Snyk on June 3rd, 2020! Find out how to migrate to Snyk and more at greenkeeper.io


The devDependency rollup was updated from 2.4.0 to 2.5.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

rollup is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ Build: This repository is not mapped to a Google Cloud Platform project. Please connect it to a project in the cloud console.

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @types/jest is breaking the build 🚨


🚨 Reminder! Less than one month left to migrate your repositories over to Snyk before Greenkeeper says goodbye on June 3rd! πŸ’œ πŸššπŸ’¨ πŸ’š

Find out how to migrate to Snyk at greenkeeper.io


The devDependency @types/jest was updated from 25.2.1 to 25.2.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/jest is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ Build: Your Google Cloud Platform project is not set up correctly for this GitHub app. Please go through the setup flow again in the cloud console.

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Aricle on Medium needs updating for Google UI changes

Describe the bug
The article on Medium includes an outdated description of how to get config data

To Reproduce
Steps to reproduce the behaviour:

  1. Go to '...'
    https://medium.com/firebase-developers/how-to-setup-firebase-authentication-with-react-in-5-minutes-maybe-10-bb8bb53e8834#2be4

It says :

On the top of the Authentication page, click on the β€œWeb Setup” button.

It will show up a modal just like this:

This is no longer how the Google UI works

Instead you need to go to

Project Overview > Project Settings > General > β€œFirebase SDK snippet” > Press β€œConfig” radio button

as per comment here
https://medium.com/@todd_12331/since-the-solution-from-njeri-cooper-is-burried-for-those-realizing-that-google-changed-the-a3877a33ce3d

If the article can be amended that would be great

Firebase npm "^9.x" support

Is your feature request related to a problem? Please describe.
Are you thinking about to support the new package of firebase (version 9+)

Describe the solution you'd like
As an expected please support of new firebase package

Describe alternatives you've considered
As alternative the firebase package already provide the ability (developed by their-self ) of authentication service

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.