io.imunity.vaadin.endpoint.common.LogoutView Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of unity-server-vaadin-endpoint-common Show documentation
Show all versions of unity-server-vaadin-endpoint-common Show documentation
Common Vaadin endpoint components
The newest version!
/*
* Copyright (c) 2021 Bixbit - Krzysztof Benedyczak. All rights reserved.
* See LICENCE.txt file for licensing information.
*/
package io.imunity.vaadin.endpoint.common;
import com.vaadin.flow.component.UI;
import com.vaadin.flow.component.html.Div;
import com.vaadin.flow.router.AfterNavigationEvent;
import com.vaadin.flow.router.AfterNavigationObserver;
import com.vaadin.flow.router.Route;
import com.vaadin.flow.server.VaadinServlet;
@Route(value = LogoutView.LOGOUT_URL)
class LogoutView extends Div implements AfterNavigationObserver
{
public static final String LOGOUT_URL = "logout";
public final VaadinWebLogoutHandler vaadinWebLogoutHandler;
public LogoutView(VaadinWebLogoutHandler vaadinWebLogoutHandler)
{
this.vaadinWebLogoutHandler = vaadinWebLogoutHandler;
}
@Override
public void afterNavigation(AfterNavigationEvent afterNavigationEvent)
{
UI.getCurrent().getPage().setLocation(
VaadinServlet.getFrontendMapping()
);
vaadinWebLogoutHandler.logout();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy