firebase-authentication

Firebase onCreate add custom claims to the auth.user

人盡茶涼 提交于 2021-02-10 06:07:01
问题 I am trying to add a custom claims, isRegistered to firebase. My firestore has another user collection to keep register info records. Now I am trying to keep a isRegistered custom claim but I can not seem to get it work. exports.addRegisteredRole = functions.database.ref('/user') .onCreate((snap, context) => { return // **I added this later, but the issue still remains.** admin.auth() .setCustomUserClaims(context.auth.uid, {isRegistered: true}) .then(() => { console.log('done', snap) return {

Sending Verification email to existing users

故事扮演 提交于 2021-02-10 05:33:31
问题 I am working on a web app with an existing user base. Email verification was not initially implemented in the sign in flow. I have successfully added code for sending verification email for all new sign ups but I also wanted to make a small page ( or modal ) where current users would be shown a button that would send the verification link to their inbox The current sign up flow where I created the user with createUserWithEmailAndPassword I was able to get access to the user.user

Flutter Firebase Authentication currentUser() returns null

一世执手 提交于 2021-02-09 11:10:42
问题 This is about Flutter Firebase Authentication plugin. I am trying to send a verification email after creating a new user, but sendEmailVerification() internally uses currentUser(). This looks like a bug to me, but just in case, I am posting a question to stackoverflow. The error is the same on Android and IOS. First two lines return FirebaseUser. The third returns null. Forth, if third is commented throws a null reference error. Thanks, Boris user = await _auth.createUserWithEmailAndPassword

Flutter Firebase Authentication currentUser() returns null

一个人想着一个人 提交于 2021-02-09 11:09:12
问题 This is about Flutter Firebase Authentication plugin. I am trying to send a verification email after creating a new user, but sendEmailVerification() internally uses currentUser(). This looks like a bug to me, but just in case, I am posting a question to stackoverflow. The error is the same on Android and IOS. First two lines return FirebaseUser. The third returns null. Forth, if third is commented throws a null reference error. Thanks, Boris user = await _auth.createUserWithEmailAndPassword

How to check if user is already logged in using Google Sign in and Firebase Auth to retrieve their data?

自闭症网瘾萝莉.ら 提交于 2021-02-08 15:27:53
问题 I have a simple game made in Flutter and I can log in the user but I don't know how to check if the user is logged and how to get user's data if so. For log in I am using this method, after log in the user I can get his data: Future<String> signInWithGoogle() async{ print("INICIALIZANDO LOGIN COM GOOGLE..."); googleSignInAccount = await googleSignIn.signIn(); googleSignInAuthentication = await googleSignInAccount.authentication; final AuthCredential credential = GoogleAuthProvider

What set of APIs count towards Firebase Auth API limits (500requests/second)?

天大地大妈咪最大 提交于 2021-02-08 15:27:18
问题 The firebase auth doc shows that you can only make Firebase Auth API calls up to 500 requests/second per service account & 1000 requests/second per project. e.g. If I use Firebase Auth Admin SDK to invoke getUserByEmail or updateUser , do these operations count toward API limits? How about verifying id tokens using verifyIdToken API? If my project verifies all requests coming in to the server from clients by verifying authIdToken, does that mean that my server's upper scaling threshold will

How to check if user is already logged in using Google Sign in and Firebase Auth to retrieve their data?

安稳与你 提交于 2021-02-08 15:27:11
问题 I have a simple game made in Flutter and I can log in the user but I don't know how to check if the user is logged and how to get user's data if so. For log in I am using this method, after log in the user I can get his data: Future<String> signInWithGoogle() async{ print("INICIALIZANDO LOGIN COM GOOGLE..."); googleSignInAccount = await googleSignIn.signIn(); googleSignInAuthentication = await googleSignInAccount.authentication; final AuthCredential credential = GoogleAuthProvider

Limiting an iOS app to installation on only one device

只愿长相守 提交于 2021-02-08 11:28:26
问题 I have an iOS app written in Swift where I want to limit each account to one device only – what is a way that I could go about limiting this access? I'm using Firebase and have a login system but the login system is not linked to Firebase Auth. 回答1: After login the use generate the token and save them into dataBase. And send this token in header when you hit any other API. If new same use login on other device, update the token in data base . Now you check this token is same or not if not

admin.auth().currentUser; returning undefined in Cloud Function

淺唱寂寞╮ 提交于 2021-02-08 11:15:57
问题 I am trying to create a function that, when a device is registered in the app, will attach this device uid to the uid of the signed-in user who registered the device (this is in another firestore collection that is automatically created when a user registers). Here is my code: exports.addDeviceToUser = functions.firestore.document('device-names/{device}').onUpdate((change, context) => { const currentUser = admin.auth().currentUser; const deviceName = context.params.device; var usersRef = db

FirebaseAuth: getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzal@9cd3393

ぐ巨炮叔叔 提交于 2021-02-08 11:01:33
问题 Online it says to downgrade the dependencies for Firebase Auth but I have done that and it does not work. 回答1: You should ensure that all your firebase dependencies are using the same version . I was also facing the same issue, using stable version 15.0.0 worked well for my case. 回答2: Check that your google-services is updated, in build.gradle.project classpath 'com.google.gms:google-services:4.0.1' and try changing your Auth to: implementation 'com.google.firebase:firebase-auth:16.0.1'