firebase-admin

NodeJS authentication with Firebase

青春壹個敷衍的年華 提交于 2020-08-21 05:04:17
问题 I would like to authenticate and keep sessions via NodeJS with Firebase. Client can't directly communicate with Firebase. In short: Client (browser) <----> NodeJs(firebase-admin) <----> Firebase I created Firebase client in NodeJS, then I used login method: var firebaseClient = require('firebase'); firebaseClient.initializeApp(config) firebaseClient.auth().signInWithEmailAndPassword(req.body.email, req.body.password).catch(function(error){ console.log(error); }) and then I created route to

NodeJS authentication with Firebase

穿精又带淫゛_ 提交于 2020-08-21 05:04:17
问题 I would like to authenticate and keep sessions via NodeJS with Firebase. Client can't directly communicate with Firebase. In short: Client (browser) <----> NodeJs(firebase-admin) <----> Firebase I created Firebase client in NodeJS, then I used login method: var firebaseClient = require('firebase'); firebaseClient.initializeApp(config) firebaseClient.auth().signInWithEmailAndPassword(req.body.email, req.body.password).catch(function(error){ console.log(error); }) and then I created route to

How to set log level for Firestore?

霸气de小男生 提交于 2020-08-06 08:34:25
问题 How to set log level for Firestore? According to documentation here, i should use setLogLevel method but i can't see method at Firestore client objects, like FirestoreClient.getFirestore() . 回答1: For those who ended up here trying to change the log level for the JS Web SDK: firebase.firestore.setLogLevel("debug"); // "debug" | "error" | "silent" Notice the lack of () after firestore, as opposed to: firebase.firestore().settings(/*...*/) 回答2: Current versions for most environments documented

How to set log level for Firestore?

喜夏-厌秋 提交于 2020-08-06 08:34:18
问题 How to set log level for Firestore? According to documentation here, i should use setLogLevel method but i can't see method at Firestore client objects, like FirestoreClient.getFirestore() . 回答1: For those who ended up here trying to change the log level for the JS Web SDK: firebase.firestore.setLogLevel("debug"); // "debug" | "error" | "silent" Notice the lack of () after firestore, as opposed to: firebase.firestore().settings(/*...*/) 回答2: Current versions for most environments documented

How to use the sendPasswordResetEmail() function on the server using the firebase-admin SDK?

你说的曾经没有我的故事 提交于 2020-08-05 19:26:31
问题 In the past, I have used firebase.auth in the web client and once a user creates another user, I link certain security logic: Once the user has been created I send an email to verify your email with the function user.sendEmailVerification (). As the user was created by another user, I assign a default password and use the sendPasswordResetEmail () function so that the user registers his new password. That has worked well for me so far, but now for many reasons I need to move that logic to my

How to use the sendPasswordResetEmail() function on the server using the firebase-admin SDK?

青春壹個敷衍的年華 提交于 2020-08-05 19:26:08
问题 In the past, I have used firebase.auth in the web client and once a user creates another user, I link certain security logic: Once the user has been created I send an email to verify your email with the function user.sendEmailVerification (). As the user was created by another user, I assign a default password and use the sendPasswordResetEmail () function so that the user registers his new password. That has worked well for me so far, but now for many reasons I need to move that logic to my

Firebase Storage Admin Error:400 Invalid Bucket Name

六月ゝ 毕业季﹏ 提交于 2020-07-10 11:43:23
问题 I'm trying to use firebase functions to do maintenance of my database and storage. Basically remove some old entries from one ref/bucket to another after they expire. The database part works great. However, the storage part, not so much. Here's how I initialize everything in my code: var functions = require('firebase-functions'); var admin = require("firebase-admin"); var serviceAccount = require('./my-app-bla-bla.json'); admin.initializeApp({ credential: admin.credential.cert(serviceAccount)

Firebase Storage Admin Error:400 Invalid Bucket Name

喜欢而已 提交于 2020-07-10 11:42:49
问题 I'm trying to use firebase functions to do maintenance of my database and storage. Basically remove some old entries from one ref/bucket to another after they expire. The database part works great. However, the storage part, not so much. Here's how I initialize everything in my code: var functions = require('firebase-functions'); var admin = require("firebase-admin"); var serviceAccount = require('./my-app-bla-bla.json'); admin.initializeApp({ credential: admin.credential.cert(serviceAccount)

How can scheduled Firebase Cloud Messaging notifications be made outside of the Firebase Console?

纵然是瞬间 提交于 2020-07-09 11:54:09
问题 Inside the Firebase Console, under the Cloud Messaging view, users are able to create test notifications. This functionality also allows you to schedule the time at which the notification will send to a device or set of devices. Is it possible to create and send scheduled FCM notifications to specific devices by using firebase cloud functions and the Firebase Admin SDK? Is there an alternative way to solving this? The current way that I send scheduled messages to users is like so: const