【问题标题】:Is there a way to protect routes in React in server-side for non-authenticated users ? (I use firebase for authentication)有没有办法在服务器端为未经身份验证的用户保护 React 中的路由? (我使用firebase进行身份验证)
【发布时间】:2019-11-05 14:49:36
【问题描述】:

我正在创建一个 Web 应用程序,使用 React 作为客户端,使用 Firebase 和 Cloud Functions 作为服务器端。有没有办法保护服务器端的路由。我找到的所有教程都是关于在 React 中保护路由的。 提前致谢。

【问题讨论】:

  • 欢迎来到 StackOverflow,请查看 here 并相应地编辑您的问题。

标签: reactjs firebase authentication


【解决方案1】:

为 Firebase 启用 JWT tokens

【讨论】:

  • 感谢您的回复。实际上目前我可以在后端从客户端检索和验证令牌,但仍然没有弄清楚如何在 React 中保护路由。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-05-05
  • 1970-01-01
  • 1970-01-01
  • 2018-09-27
  • 2021-05-26
  • 1970-01-01
  • 2017-09-11
相关资源
最近更新 更多