Re: [Firebase] Firebase Authentication Problem in React

153 views
Skip to first unread message
Message has been deleted

Nurmyrat Nurmyrat

unread,
Oct 23, 2020, 5:24:08 AM10/23/20
to fireba...@googlegroups.com
var provider = new firebase.auth.FacebookAuthProvider();
firebase.auth().signInWithRedirect(provider);


firebase.auth().getRedirectResult().then(function(result) {
 
if (result.credential) {
   
// This gives you a Facebook Access Token. You can use it to access the Facebook API.
   
var token = result.credential.accessToken;
   
// ...
 
}
 
// The signed-in user info.
 
var user = result.user;
}).catch(function(error) {
 
// Handle Errors here.
 
var errorCode = error.code;
 
var errorMessage = error.message;
 
// The email of the user's account used.
 
var email = error.email;
 
// The firebase.auth.AuthCredential type that was used.
 
var credential = error.credential;
 
// ...
});

But make sure your OAuth redirect URI (e.g. my-app-12345.firebaseapp.com/__/auth/handler) is listed as one of your OAuth redirect URIs in your Facebook app's settings page on the Facebook for Developers site in the Product Settings > Facebook Login config.

чт, 22 окт. 2020 г. в 22:32, Ahsan Azeemi Official <funwithah...@gmail.com>:
I want to add Facebook Authentication on My Website. But. Wen my code is compiling it is saying that the code (give a part of it next) isn't a constructor
i've linked all required firebase packages

code of firebase.js file
import * as firebase from 'firebase/app';
import 'firebase/database'
import 'firebase/auth'

i'm trying to get it on App.js
var provider = new firebase.auth.FacebookAuthProvider();
please help me

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/81c77d88-9e50-4564-b760-d4e070b53eb7n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages