10 examples of 'get current user firebase' in JavaScript

Every line of 'get current user firebase' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
14public getCurrentUser() : firebase.User | null {
15 return firebase
16 .auth()
17 .currentUser;
18}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

7export function getUser () {
8 return firebase.auth(app).currentUser
9}
19currentUser() {
20 return firebase.auth().currentUser
21}
42currentUser() {
43 return firebase.auth().currentUser
44}
37protected getCurrentUser(): firebase.User | null {
38 return this.auth.currentUser;
39}
20private getUserFromFirebaseUser(user): AuthenticatedUser | null {
21 if (user == null) {
22 return null
23 }
24 return {
25 uid: user.uid,
26 displayName: user.displayName,
27 email: user.email,
28 emailVerified: user.emailVerified,
29 }
30}
87getUserProfileInformation() {
88 const user = firebase.auth().currentUser;
89 let name, email, photoUrl, uid, emailVerified;
90
91 if (user != null) {
92 name = user.displayName;
93 email = user.email;
94 photoUrl = user.photoURL;
95 emailVerified = user.emailVerified;
96 uid = user.uid;
97 }
98}
15getUser(userKey){
16 return this.db.collection('users').doc(userKey).snapshotChanges();
17}
249private async getCurrentUserEmail() {
250 const user = await this.rm.getUserLogin();
251 if (user) {
252 return user.email;
253 } else {
254 return 'annonymous user';
255 }
256}
4export function loadUser(userId) {
5 return firebaseDb
6 .collection('users')
7 .doc(userId)
8 .get();
9}

Related snippets