How to get currently logged in auth state/user from angularfire2

前端 未结 4 1467
囚心锁ツ
囚心锁ツ 2021-02-05 18:55

I have an ionic2 app and am using Firebase and angularFire2. I\'d like to get the current authentication state and current auth object/user from firebase using angularFire2.

4条回答
  •  無奈伤痛
    2021-02-05 19:39

    current authentication state is available from the injected FirebaseAuth. You can get the actual auth data auth.getAuth()

    See: https://github.com/angular/angularfire2/blob/master/src/providers/auth.ts#L99

提交回复
热议问题