Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Authentication React中的身份验证流_Authentication_Reactjs_Store_Redux - Fatal编程技术网

Authentication React中的身份验证流

Authentication React中的身份验证流,authentication,reactjs,store,redux,Authentication,Reactjs,Store,Redux,我有一个应用程序,它在容器级别(wayout)具有身份验证,并且我正在为经过身份验证的组件使用redux auth包装器 在这些组件中,我希望进行只影响本地状态的经过身份验证的调用。有时服务器可能会返回401,在这种情况下,我知道我需要用如下内容刷新令牌:status==401&&myLoginAction() 结构看起来像这样: Container [Connects to root store with auth] |- Auth |- Login |- Authenticated p

我有一个应用程序,它在容器级别(wayout)具有身份验证,并且我正在为经过身份验证的组件使用redux auth包装器

在这些组件中,我希望进行只影响本地状态的经过身份验证的调用。有时服务器可能会返回401,在这种情况下,我知道我需要用如下内容刷新令牌:
status==401&&myLoginAction()

结构看起来像这样:

Container [Connects to root store with auth]
 |- Auth
 |- Login
 |- Authenticated page wrapped with redux-auth-wrapper
    |- Action to update state, needs to be authenticated

问题:
  • 我的认证行动应该在哪里?我可以从更高的名称空间调用它到我的组件中吗
  • 我可以用身份验证操作包装我的低级操作吗?有什么好的例子吗?我只见过单店认证。还是我应该这样处理
  • 如何从较低的组件中访问登录操作