小编mul*_*sie的帖子

用户使用 Firebase 身份验证登录后如何重定向?

用户登录后如何重定向到其他网页?

目前,当用户登录时,会检索数据,但不会将用户重定向到其他网站。

我知道我应该使用“getRedirectResult”,但有人可以告诉我如何使用它以及如何将用户重定向到不同的网页,维护检索到的用户数据。

我的 javascript 工作:

function toggleSignIn() {
  if (!firebase.auth().currentUser) {
    // [START createprovider]
    var provider = new firebase.auth.GoogleAuthProvider();
    // [END createprovider]
    // [START addscopes]
    provider.addScope('https://www.googleapis.com/auth/plus.login');
    // [END addscopes]
    // [START signin]
    firebase.auth().signInWithPopup(provider).then(function(result) {
      // This gives you a Google Access Token. You can use it to access the Google API.
      var token = result.credential.accessToken;
      // The signed-in user info.
      var user = result.user;
      // [START_EXCLUDE]
      document.getElementById('quickstart-oauthtoken').textContent = token;
      // [END_EXCLUDE]
    }).catch(function(error) {
      // Handle Errors here.
      var errorCode …
Run Code Online (Sandbox Code Playgroud)

javascript firebase firebase-authentication

7
推荐指数
1
解决办法
2万
查看次数

Google Firebase忘记了密码

你如何在我的方法中实现忘记密码方法.我正在创建一个即将到期的HTML项目.我的代码:

    function toggleSignIn() {
   if (!firebase.auth().currentUser) {
// [START createprovider]
var provider = new firebase.auth.GoogleAuthProvider();
// [END createprovider]
// [START addscopes]
provider.addScope('https://www.googleapis.com/auth/plus.login');
// [END addscopes]
// [START signin]
firebase.auth().signInWithPopup(provider).then(function(result) {
  // This gives you a Google Access Token. You can use it to access the    Google API.
  var token = result.credential.accessToken;
  // The signed-in user info.
  var user = result.user;
  // [START_EXCLUDE]
  document.getElementById('quickstart-oauthtoken').textContent = token;
  // [END_EXCLUDE]
}).catch(function(error) {
  // Handle Errors here.
  var errorCode = error.code;
  var errorMessage = …
Run Code Online (Sandbox Code Playgroud)

html javascript firebase firebase-authentication

5
推荐指数
1
解决办法
8184
查看次数