在页面加载时调用Authenticate API,以查看用户的会话是否已通过身份验证。我认为Spring Security可以做到这一点。根据响应,您可以限制路线。
我当前的项目状态:
问题:
谢谢!
我当前的项目状态:我正在使用ReactJs(前端)和spring boot(后端)来开发Web应用程序。部署此应用程序时,我使用...
在页面加载时调用Authenticate API,以查看用户的会话是否已通过身份验证。我认为Spring Security可以做到这一点。根据响应,您可以限制路线。
<Route {...rest} render={({ location }) => authenticateApiResponse.authenticated ? ( <Redirect to={{ pathname: "/profile", state: { from: location } }} /> ) : ( <Redirect to={{ pathname: "/login", state: { from: location } }} /> ) } />
现在用户只有通过后端API验证的用户才能进入个人资料
在页面加载时调用Authenticate API,以查看用户的会话是否已通过身份验证。我认为Spring Security可以做到这一点。根据响应,您可以限制路线。