jjzjj

firebase-authentication

全部标签

javascript - Firebase:异步/等待事务

我正在尝试对事务使用异步/等待。但是出现错误“参数“updateFunction”不是有效函数。”vardocRef=admin.firestore().collection("docs").doc(docId);lettransaction=admin.firestore().runTransaction();letdoc=awaittransaction.get(docRef);if(!doc.exists){throw("docnotfound");}varnewLikes=doc.data().likes+1;awaittransaction.update(docRef,{li

javascript - 如何在使用 firebase 的 react native 中进行单元测试?

我对Jest单元测试很陌生,所以像模拟模块这样的东西令人困惑。在reactnative中,有一个组件使用firebase数据库从给定的ref返回数据://whenthedataofthecurrentuserisavailableuserRef.child(user.uid).on('value',snap=>{//checkofval()consistsdataif(snap.val()){letauthUser=snap.val(),isPatient=authUser.type==="Patient",//Weupdatethestateobjectsothatthecompon

javascript - 在 Firebase 云函数中包含异步函数 (eslint "Parsing error: Unexpected token function")

问题如何将async辅助方法添加到CloudFunctionsindex.js文件中?在将fs.writefile转换为Promise时,需要一个async函数才能使用await,如本文所述StackOverflow帖子:fs.writeFileinapromise,asynchronous-synchronousstuff.但是,lint不赞成在exports函数之外向index.js文件添加额外的方法。错误第84行引用辅助函数asyncfunctionwriteFile。Users/adamhurwitz/coinverse/coinverse-cloud-functions/fu

javascript - 如何使用 Cloud Functions for Firebase 与 .onWrite 或 onchange 比较新旧值?

让我们采用以下数据结构:现在我想用Firebase函数刷新accessTokenFacebook。我测试了两个选项:onWrite和:onChangedonWrite对我来说看起来最好,但具有以下功能:exports.getFacebookAccessTokenOnchange=functions.database.ref('/users/{uid}/userAccountInfo/lastLogin').onWrite(event=>{constlastLogin=event.data;letdateObject=newDate();letcurrentDate=dateObject

javascript - Firebase 版本 3 中的 changePassword() 方法

我在我的ReactNativeiOS项目中使用firebasever3.2.1。我阅读了2.4.2版本的日志here,有一个名为changePassword()的方法可以用来更改用户的密码。但是当我查看Firebase版本3.2.1的文档时,我找不到任何名为changePassword()的方法。所以我想知道,changePassword()方法是否不能再在Firebase版本3中使用?谢谢。 最佳答案 自Firebasev3.0以来,changePassword方法不再可用。如果您需要重置用户密码,您可以使用自定义电子邮件操作处理

javascript - 使用 ControllerAs 语法的 Firebase 3 向数据绑定(bind)

我正在尝试使用firebase和angularfire进行三向数据绑定(bind)。你可以看到我在Plunker中得到了什么:http://plnkr.co/edit/RGA4jZK3Y6n4RkPCHK37app.js:angular.module('ideaBattle',["firebase"]);服务:angular.module('ideaBattle').constant('FBURL','https://ideabattle.firebaseio.com/').service('Ref',['FBURL',Firebase]).factory('dataBank',fun

javascript - Firebase 检测用户是否存在

如何通过ReactNative检查Signup按钮中的Firebase身份验证中是否存在用户?这是我的登录页面代码:exportdefaultclassLoginextendsComponent{constructor(props){super(props)this.state={email:'',password:'',response:''}this.signUp=this.signUp.bind(this)this.login=this.login.bind(this)}asyncsignUp(){try{awaitfirebase.auth().createUserWithEm

javascript - 使用 Redux-Saga 的 Firebase 身份验证不起作用

我正在尝试使用firebase身份验证创建一个新用户。我正在使用redux-saga进行上述调用。下面是我的saga.js:import{takeLatest,put}from'redux-saga/effects';import{SIGN_UP,AUTHENTICATION_FAILED,SIGN_UP_SUCCESS}from'../actions/index';importfirebasefrom'firebase';function*signUp(action){console.log("abouttocallauthentication");//Thisbeingprinte

javascript - Firebase Web Auth 在移动设备上不起作用?

我打算为我的网络应用程序使用Firebase的提供商身份验证,但它似乎不适用于移动设备。该网站在这里:https://cypher.city然后当你点击这个按钮时:将出现一个弹出窗口。当你点击这个按钮时:然后它应该进入谷歌提供商身份验证流程。我的代码如下所示:varprovider=newfirebase.auth.GoogleAuthProvider();firebase.auth().signInWithRedirect(provider).then((result)=>{//console.log('@$signinwihtgoogleworked!'+e+',useris:'+

javascript - 将 base64 编码的图像保存到 Firebase 存储

使用firebase3.0.x,是否可以将base64编码的图像保存到新的Firebase存储服务?我在上传图像之前使用Canvas在浏览器中调整图像大小,并将它们输出为base64jpeg。我知道Storageapi可以接受Blob,但我当前的项目需要IE9支持。 最佳答案 无需将BASE64转blob,只需使用putString函数即可。firebase.storage().ref('/your/path/here').child('file_name').putString(your_base64_image,‘base64’