我正在尝试使用Firebase Auth来使用Google登录。我已启用Google登录作为一种方法,并将我的域添加到列入白名单的域列表中,如下所示:
我的JavaScript代码非常简单,就像这样:
const auth = firebase.auth();
const provider = new firebase.auth.GoogleAuthProvider();
firebase.auth().signInWithPopup(provider).then(function(result) {
var token = result.credential.accessToken;
var user = result.user;
}).catch(function(error) {
console.log(error);
});
但是当我运行此代码时,出现以下错误:
This domain (<my domain>.38) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.
我在做什么错了?