【问题标题】:How get Current-User At Asp.net-Core at cross platform react redux?如何在跨平台 React redux 上获取 Asp.net-Core 的 Current-User?
【发布时间】:2017-04-03 09:02:07
【问题描述】:

你好有一个ReportController(没有它的视图)用于创建保存更新一个表的数据。 我使用 react redux 和 fetch 来运行这个控制器的动作。 对于身份验证,我使用的是 Asp.net Core Identity。并且身份验证发生在 asp.net 上,而不是 react-redux 上。我可以使用 HttpContext 在管理和帐户控制器处获取当前用户。但是当我尝试使用HttpContext 在我的ReportController 获取当前用户同时创建新数据时,我得到null 和HttpContext。有什么建议吗?

【问题讨论】:

    标签: asp.net-core react-redux asp.net-core-identity


    【解决方案1】:

    好的,问题是我没有用我的 fetch 发送 cookie。

    credentials: 'same-origin'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-15
      • 1970-01-01
      • 2021-11-26
      • 1970-01-01
      相关资源
      最近更新 更多