Nodejs Facebook身份验证不适用于Reactjs

时间:2019-05-01 06:17:14

标签: node.js reactjs facebook react-router

我在后端使用Facebook创建了登录名。后端在nodejs中创建。

login.js--nodeJS

const express = require("express");
const passport = require("../../server/passport");
const app = express();

app.get(
  "/auth/facebook",
  passport.authenticate("facebook", { scope: ["email"] })
);

app.get(
  "/auth/facebook/callback",
  passport.authenticate("facebook", {
    successRedirect: "/Movie/v1.0/Add",
    failureRedirect: "/"
  })
);
module.exports = app;

register.jsx

<a
              href="https://localhost:3000/users/auth/facebook"
              class="btn btn-primary"
            >
              <span class="fa fa-facebook" /> Login with Facebook
            </a>

在Google Chrome浏览器上单击按钮错误消息时

  

该站点无法提供安全连接,本地主机发送了无效的   响应。

0 个答案:

没有答案