Closed mbbender closed 6 years ago
Following the examples in the README didn't work for you? For instance, see the AnonymousAuthProvider below the GoogleAuthProvider:
// Import FirebaseAuth and firebase.
import React from 'react';
import StyledFirebaseAuth from 'react-firebaseui/StyledFirebaseAuth';
import firebase from 'firebase';
// Configure Firebase.
const config = {
apiKey: 'AIzaSyAeue-AsYu76MMQlTOM-KlbYBlusW9c1FM',
authDomain: 'myproject-1234.firebaseapp.com',
// ...
};
firebase.initializeApp(config);
// Configure FirebaseUI.
const uiConfig = {
// Popup signin flow rather than redirect flow.
signInFlow: 'popup',
// Redirect to /signedIn after sign in is successful. Alternatively you can provide a callbacks.signInSuccess function.
signInSuccessUrl: '/signedIn',
// We will display Google and Facebook as auth providers.
signInOptions: [
firebase.auth.GoogleAuthProvider.PROVIDER_ID,
firebase.auth.AnonymousAuthProvider.PROVIDER_ID
]
};
class SignInScreen extends React.Component {
render() {
return (
<div>
<h1>My App</h1>
<p>Please sign-in:</p>
<StyledFirebaseAuth uiConfig={uiConfig} firebaseAuth={firebase.auth()}/>
</div>
);
}
}
Closing but let me know if you still had issues.
I believe i had a similar issue. Using typescript and wasn't able to use firebase.auth.AnonymousAuthProvider.PROVIDER_ID
because AnonymousAuthProvider
isn't available on the firebase.auth
object, even when tsignoring the type, so it really wasn't there.
Instead i had to do
import { auth as firebaseuiAuth } from 'firebaseui';
...
signInOptions: [
firebase.auth.GoogleAuthProvider.PROVIDER_ID,
firebase.auth.FacebookAuthProvider.PROVIDER_ID,
firebase.auth.EmailAuthProvider.PROVIDER_ID,
firebaseuiAuth.AnonymousAuthProvider.PROVIDER_ID,
],
works but pretty weird ?
Is this issue scheduled for fix some day?
...weird ....4 years now and this issue persists
@JemarJones Life saver. Thanks!
How can you get access to the underlying firebaseui instance? I tried a handful of options but thing seems to work. I'd like to set the AnonymousAuthProvider option.