diff --git a/src/main/java/com/application/munera/views/LoginView.java b/src/main/java/com/application/munera/views/LoginView.java index eea7a22..9d9adcd 100644 --- a/src/main/java/com/application/munera/views/LoginView.java +++ b/src/main/java/com/application/munera/views/LoginView.java @@ -3,6 +3,8 @@ package com.application.munera.views; import com.vaadin.flow.component.html.H1; import com.vaadin.flow.component.html.H2; import com.vaadin.flow.component.login.LoginForm; +import com.vaadin.flow.component.login.LoginI18n; +import com.vaadin.flow.component.notification.Notification; import com.vaadin.flow.component.orderedlayout.VerticalLayout; import com.vaadin.flow.router.BeforeEnterEvent; import com.vaadin.flow.router.BeforeEnterObserver; @@ -28,9 +30,18 @@ public class LoginView extends VerticalLayout implements BeforeEnterObserver { login.setAction("login"); + // Customize the LoginForm + LoginI18n i18n = LoginI18n.createDefault(); + i18n.getForm().setForgotPassword("Forgot password?"); + login.setI18n(i18n); + + // Add a listener for the Forgot password button + login.addForgotPasswordListener(event -> { + Notification.show("Tough shit, feature aint ready yet!", 3000, Notification.Position.BOTTOM_CENTER); + }); + add(new H1("Munera"), new H2("An expense tracking application"), login); } - @Override public void beforeEnter(BeforeEnterEvent beforeEnterEvent) { if(beforeEnterEvent.getLocation()