[英]Getting Firebase Current User Info
How do I get the current user's information in my application without using a listener like onStateChanged
? 如何在不使用
onStateChanged
监听器的情况下在应用程序中获取当前用户的信息? Right now I'm using: 现在我正在使用:
auth.createUserWithEmailAndPassword(email,password).then(function(user){ }
to get the user info then assign it to a variable .. but when I refresh the page, the variable loses its assigned value 获取用户信息然后将其分配给变量..但是当我刷新页面时,变量会丢失其指定的值
Make a synchronous call by using $firebaseAuth
service 使用
$firebaseAuth
服务进行同步调用
$firebaseAuth().$getAuth();
It will return the currently signed-in user or null
if no user is signed in. 它将返回当前已登录的用户,如果没有用户登录,则返回
null
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.