I'm developing two separate projects: one is Polymer
app with Service worker
(scaffolded with Polymer CLI) and second app is Spring Boot
with Vaadin
and its itegration library Vaadin Spring
. Both applications are running on localhost:8080
.
On SpringBoot app, non-authenticated user is redirected to /login
. After successful authentication user should be redirected back to /
, but instead is redirected to url http://localhost:8080/service-worker.js
, where is displayed default spring 404
page. When I manually change url back to /
, SpringBoot app is working again.
- this behavior occured after I was working on Polymer app and switched to SpringBoot
- tested on Chrome and Firefox
- clearing browser cache helps
- Vaadin is also using hashbang
I can't find source of the problem (if is it Polymer or SpringBoot+Vaadin) and clearing cache or manually changing URL every time is frustrating.
EDIT:
I'm using default handler SavedRequestAwareVaadinAuthenticationSuccessHandler
provided by Vaadin Spring
. It should redirect back to previous URL or to fallback URL /
.
@Bean(name = VaadinSharedSecurityConfiguration.VAADIN_AUTHENTICATION_SUCCESS_HANDLER_BEAN)
VaadinAuthenticationSuccessHandler vaadinAuthenticationSuccessHandler(@SuppressWarnings("SpringJavaAutowiringInspection") HttpService httpService, VaadinRedirectStrategy vaadinRedirectStrategy) {
return new SavedRequestAwareVaadinAuthenticationSuccessHandler(httpService, vaadinRedirectStrategy, "/");
}