【发布时间】:2016-10-21 12:02:49
【问题描述】:
我正在开发两个独立的项目:一个是Polymer 应用程序和Service worker(使用Polymer CLI 搭建),第二个应用程序是Spring Boot 和Vaadin 及其迭代库Vaadin Spring。这两个应用程序都在localhost:8080 上运行。
在 SpringBoot 应用上,未经身份验证的用户被重定向到 /login。成功认证后,用户应该被重定向回/,而是被重定向到urlhttp://localhost:8080/service-worker.js,这里显示默认的spring404页面。当我手动将 url 更改回/ 时,SpringBoot 应用程序再次运行。
- 此行为发生在我使用 Polymer 应用程序并切换到 SpringBoot 之后
- 在 Chrome 和 Firefox 上测试
- 清除浏览器缓存有帮助
- Vaadin 也在使用 hashbang
我找不到问题的根源(如果是 Polymer 或 SpringBoot+Vaadin)并且每次都清除缓存或手动更改 URL 令人沮丧。
编辑:
我正在使用Vaadin Spring 提供的默认处理程序SavedRequestAwareVaadinAuthenticationSuccessHandler。它应该重定向回之前的 URL 或后备 URL /。
@Bean(name = VaadinSharedSecurityConfiguration.VAADIN_AUTHENTICATION_SUCCESS_HANDLER_BEAN)
VaadinAuthenticationSuccessHandler vaadinAuthenticationSuccessHandler(@SuppressWarnings("SpringJavaAutowiringInspection") HttpService httpService, VaadinRedirectStrategy vaadinRedirectStrategy) {
return new SavedRequestAwareVaadinAuthenticationSuccessHandler(httpService, vaadinRedirectStrategy, "/");
}
【问题讨论】:
-
请发布您登录后重定向的代码。
标签: spring spring-boot polymer vaadin service-worker