我正在使用Firebase和Redirect登录。在这里,第4行的代码不起作用,我在哪里弄错了?
export const startLogIn = () =>{
return () => {
firebase.auth().signInWithRedirect(googleAuthProvider);
return firebase.auth().getRedirectResult()
.then(result => {
console.log(result);
const profile = result.user;
const user = {
uid : profile.uid,
name : profile.displayName,
avatar : profile.photoURL
}
if(result.additionalUserInfo.isNewUser){
axios.post(`http://localhost:5000/api/user`, user)
.then(res => {
console.log(res.data);
});
}
});
};
};