0

我正在尝试使用终端用户提示的电子邮件和密码登录。

我尝试通过以下代码使用“pyrebase”、“pyrebase3”和“pyrebase4”:

def sign_in():
    global auth
    global user
    email = input("Please, enter your email")
    password = input("Please, enter your password")
    user = auth.sign_in_with_email_and_password(email, password)
    get_user_id(user)

但是,我不断收到错误消息: AttributeError: 'str' object has no attribute 'sign_in_with_email_and_password'

它应该很简单,但我想不出还有什么可以尝试的!

4

1 回答 1

0

这对我有用。

def _create_connection(self):
    _firebase = pyrebase.initialize_app(self.config)
    self.auth = _firebase.auth()
    self.user = self.auth.sign_in_with_email_and_password(self.email, self.password)
    self.firebase = _firebase.database()

您是否初始化了应用程序并调用了身份验证?

于 2019-04-01T16:28:20.507 回答