Package io.jmix.flowui.sys
Class LoginViewRedirectSupport
java.lang.Object
io.jmix.flowui.sys.LoginViewRedirectSupport
Provides shared checks used to redirect an already authenticated user from the configured login view.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CurrentAuthenticationprotected UiPropertiesprotected ViewRegistry -
Constructor Summary
ConstructorsConstructorDescriptionLoginViewRedirectSupport(UiProperties uiProperties, CurrentAuthentication currentAuthentication, ViewRegistry viewRegistry) -
Method Summary
Modifier and TypeMethodDescriptionFinds the configured main view.booleanisLoginView(Class<? extends com.vaadin.flow.component.Component> navigationTarget) Checks whether the navigation target is the configured login view.booleanChecks whether the current authentication is set and is not anonymous.
-
Field Details
-
uiProperties
-
currentAuthentication
-
viewRegistry
-
-
Constructor Details
-
LoginViewRedirectSupport
public LoginViewRedirectSupport(UiProperties uiProperties, CurrentAuthentication currentAuthentication, ViewRegistry viewRegistry)
-
-
Method Details
-
isLoginView
Checks whether the navigation target is the configured login view.- Parameters:
navigationTarget- navigation target class- Returns:
trueif the target matches the configured login view
-
isUserAuthenticated
public boolean isUserAuthenticated()Checks whether the current authentication is set and is not anonymous.- Returns:
trueif the current user is authenticated
-
findMainViewInfo
Finds the configured main view.- Returns:
- main view info, or an empty optional if the main view is not configured or not registered
-