Class LoginView
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<T>
io.jmix.flowui.view.View<io.jmix.flowui.component.layout.ViewLayout>
io.jmix.flowui.view.StandardView
de.bytestore.hostinger.security.view.login.LoginView
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasStyle,com.vaadin.flow.i18n.LocaleChangeObserver,com.vaadin.flow.router.AfterNavigationObserver,com.vaadin.flow.router.BeforeEnterObserver,com.vaadin.flow.router.BeforeLeaveObserver,com.vaadin.flow.router.HasDynamicTitle,com.vaadin.flow.router.internal.AfterNavigationHandler,com.vaadin.flow.router.internal.BeforeEnterHandler,com.vaadin.flow.router.internal.BeforeLeaveHandler,io.jmix.flowui.fragment.FragmentOwner,Serializable
@Route("login")
@ViewController("security_LoginView")
@ViewDescriptor("login-view.xml")
public class LoginView
extends io.jmix.flowui.view.StandardView
implements com.vaadin.flow.i18n.LocaleChangeObserver
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.flowui.view.View
io.jmix.flowui.view.View.AfterCloseEvent, io.jmix.flowui.view.View.BeforeCloseEvent, io.jmix.flowui.view.View.BeforeShowEvent, io.jmix.flowui.view.View.InitEvent, io.jmix.flowui.view.View.PostReadyEvent, io.jmix.flowui.view.View.QueryParametersChangeEvent, io.jmix.flowui.view.View.ReadyEvent, io.jmix.flowui.view.View.RestoreComponentsStateEvent -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidlocaleChange(com.vaadin.flow.i18n.LocaleChangeEvent event) Handles the locale change event by updating the UI component labels and page title to the new locale.voidonInit(io.jmix.flowui.view.View.InitEvent event) Initializes the login view when the initialization event occurs.voidonLoginBtnClick(com.vaadin.flow.component.ClickEvent<io.jmix.flowui.kit.component.button.JmixButton> event) Handles the login button click event.voidonPasswordResetBtnClick(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.html.Span> event) Handles the click event on the password reset button.voidonRegisterBtnClick(com.vaadin.flow.component.ClickEvent<io.jmix.flowui.kit.component.button.JmixButton> event) Handles the click event on the "Register" button.voidonRegisterSpanClick(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.html.Span> event) Handles the click event on the 'Register' span.Methods inherited from class io.jmix.flowui.view.View
afterNavigation, beforeEnter, beforeLeave, close, close, closeWithDefaultAction, getId, getPageTitle, isPreventBrowserTabClosing, setId, setPageTitle, setPreventBrowserTabClosingMethods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElementMethods inherited from class com.vaadin.flow.component.Component
findAncestor, from, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, isAttached, isVisible, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, setVisibleMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Constructor Details
-
LoginView
public LoginView()
-
-
Method Details
-
onInit
@Subscribe public void onInit(io.jmix.flowui.view.View.InitEvent event) Initializes the login view when the initialization event occurs. This method sets up the available locales and default credentials, and configures the view mode to "login". Additionally, it loads the registration settings from the application settings in a system-authenticated context, and setups the fields based on these settings.- Parameters:
event- the initialization event containing context information for the initialization process
-
onRegisterSpanClick
@Subscribe(id="registerSpan", subject="clickListener") public void onRegisterSpanClick(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.html.Span> event) Handles the click event on the 'Register' span. This method toggles the current view mode between "register" and "login" when the register span is clicked. It updates the UI components based on the new view mode.- Parameters:
event- the click event associated with the Span component.
-
onPasswordResetBtnClick
@Subscribe(id="passwordResetSpan", subject="clickListener") public void onPasswordResetBtnClick(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.html.Span> event) Handles the click event on the password reset button. This method sets the view mode to "resetPassword" when the password reset button is clicked.- Parameters:
event- the click event associated with the Span
-
onLoginBtnClick
@Subscribe(id="loginBtn", subject="clickListener") public void onLoginBtnClick(com.vaadin.flow.component.ClickEvent<io.jmix.flowui.kit.component.button.JmixButton> event) Handles the login button click event. This method performs user authentication including TOTP (Time-based One-Time Password) verification. If TOTP is enabled for the user, it prompts for the OTP code or a recovery code. Upon successful verification, the user is authenticated. If TOTP is not enabled, it proceeds to authenticate the user directly. If authentication fails, appropriate error messages are logged.- Parameters:
event- the click event on the login button
-
localeChange
public void localeChange(com.vaadin.flow.i18n.LocaleChangeEvent event) Handles the locale change event by updating the UI component labels and page title to the new locale.- Specified by:
localeChangein interfacecom.vaadin.flow.i18n.LocaleChangeObserver- Parameters:
event- The event representing the locale change.
-
onRegisterBtnClick
@Subscribe(id="registerBtn", subject="clickListener") public void onRegisterBtnClick(com.vaadin.flow.component.ClickEvent<io.jmix.flowui.kit.component.button.JmixButton> event) Handles the click event on the "Register" button. This method validates the UI components for user registration (including password, password repeat, and username). If all components are valid, it proceeds to register the user using the provided username and password.- Parameters:
event- the click event associated with the JmixButton
-