简体   繁体   English

FirebaseAuth 中不存在 setPersistence?

[英]setPersistence does not exist in FirebaseAuth?

I am following the Firebase docs on how to set persistence of my login: https://firebase.google.com/docs/auth/web/auth-state-persistence我正在关注有关如何设置登录持久性的 Firebase 文档: https://firebase.google.com/docs/auth/web/auth-state-persistence

I have a Firebase instance via: FirebaseAuth mAuth;我有一个 Firebase 实例,通过:FirebaseAuth mAuth;

which I use to perform mAuth.signInWithEmailAndPassword.我用来执行 mAuth.signInWithEmailAndPassword。 However, setPersistence does not exist in this mAuth object and I cannot find it elsewhere.但是,此 mAuth object 中不存在 setPersistence,我无法在其他地方找到它。 Does anyone know why this is occurring and how I can properly set the authentication state persistence here?有谁知道为什么会发生这种情况以及如何在这里正确设置身份验证 state 持久性?

You're looking at the documentation for the Firebase JavaScript/Web SDK, while you are using Java yourself.当您自己使用 Java 时,您正在查看 Firebase JavaScript/Web SDK 的文档。

In the Android SDK, authentication credentials are always persisted.在 Android SDK 中,始终保留身份验证凭据。 You don't have to do anything for that, and there's no API method to change this.您无需为此做任何事情,并且没有 API 方法可以更改此设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM