How to use the reactfire.useAuth function in reactfire

To help you get started, we’ve selected a few reactfire examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github FirebaseExtended / reactfire / sample / src / Auth.js View on Github external
const SignInForm = () => {
  const auth = useAuth();

  const uiConfig = {
    signInFlow: 'popup',
    signInOptions: [auth.GoogleAuthProvider.PROVIDER_ID],
    callbacks: {
      // Avoid redirects after sign-in.
      signInSuccessWithAuthResult: () => false
    }
  };

  return ;
};
github FirebaseExtended / reactfire / sample / src / Auth.js View on Github external
const UserDetails = ({ user }) => {
  const auth = useAuth();

  return (
    <>
      <h3>Displayname: {user.displayName}</h3>
      <h3>Providers:</h3>
      <ul>
        {user.providerData.map(profile =&gt; (
          <li>{profile.providerId}</li>
        ))}
      </ul>
      <button> signOut(auth)}&gt;Sign Out</button>
    
  );
};