如何创建“凭证” Firebase web user.reauthenticate()方法所需的对象? [英] How to create "credential" object needed by Firebase web user.reauthenticate() method?
问题描述
新文档中的(不清楚)示例:
var user = firebase.auth()。currentUser;
var凭证;
//提示用户重新提供登录凭据
user.reauthenticate(credential).then(function(){
使用v3 Firebase客户端,我应该如何创建这个凭证
对象
$ p
$ b $重复验证(email,密码) (如登录方法)
reauthenticate({email,password})
只有一个参数)不幸的是:(
我不计算在新文档中搜索相关信息的浪费时间...我非常想念那个神话般的firebase.com文档,但是想要切换到v3 for firebase.storage ...
我设法使其工作,文档应该更新,以包括谁不想花费太多的时间在穷举 - 但难以阅读的参考。
凭证对象是这样创建的:
const user = firebase.auth()。currentUser;
常规凭证= firebase.auth.EmailAuthProvider.credential(
user.email,
userProvidedPassword
);
The (unclear) example in the new docs:
var user = firebase.auth().currentUser;
var credential;
// Prompt the user to re-provide their sign-in credentials
user.reauthenticate(credential).then(function() {
With the v3 Firebase client, how should I create this credential
object?
I tried:
reauthenticate(email, password)
(like the login method)reauthenticate({ email, password })
(the docs mention one argument only)
No luck :(
PS: I don't count the hours wasted searching for relevant info in the new docs... I miss so much the fabulous firebase.com docs, but wanted to switch to v3 for firebase.storage...
I managed to make it work, docs should be updated to include this for who does not want to spend too much time in the exhaustive-but-hard-to-read reference.
The credential object is created like so:
const user = firebase.auth().currentUser;
const credential = firebase.auth.EmailAuthProvider.credential(
user.email,
userProvidedPassword
);
这篇关于如何创建“凭证” Firebase web user.reauthenticate()方法所需的对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!