|
@@ -30,17 +30,23 @@ public class LoginAction extends FessLoginAction {
|
|
|
|
|
|
@Execute
|
|
@Execute
|
|
public HtmlResponse index() {
|
|
public HtmlResponse index() {
|
|
|
|
+ return asIndexPage(null).useForm(LoginForm.class);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private HtmlResponse asIndexPage(final LoginForm form) {
|
|
|
|
+ if (form != null) {
|
|
|
|
+ form.clearSecurityInfo();
|
|
|
|
+ }
|
|
return asHtml(path_Login_IndexJsp).renderWith(data -> {
|
|
return asHtml(path_Login_IndexJsp).renderWith(data -> {
|
|
RenderDataUtil.register(data, "notification", fessConfig.getNotificationLogin());
|
|
RenderDataUtil.register(data, "notification", fessConfig.getNotificationLogin());
|
|
- }).useForm(LoginForm.class);
|
|
|
|
|
|
+ saveToken();
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
@Execute
|
|
@Execute
|
|
public HtmlResponse login(final LoginForm form) {
|
|
public HtmlResponse login(final LoginForm form) {
|
|
- validate(form, messages -> {}, () -> {
|
|
|
|
- form.clearSecurityInfo();
|
|
|
|
- return asHtml(path_Login_IndexJsp);
|
|
|
|
- });
|
|
|
|
|
|
+ validate(form, messages -> {}, () -> asIndexPage(form));
|
|
|
|
+ verifyToken(() -> asIndexPage(form));
|
|
final String username = form.username;
|
|
final String username = form.username;
|
|
final String password = form.password;
|
|
final String password = form.password;
|
|
form.clearSecurityInfo();
|
|
form.clearSecurityInfo();
|
|
@@ -50,9 +56,7 @@ public class LoginAction extends FessLoginAction {
|
|
return getHtmlResponse();
|
|
return getHtmlResponse();
|
|
});
|
|
});
|
|
} catch (final LoginFailureException lfe) {
|
|
} catch (final LoginFailureException lfe) {
|
|
- throwValidationError(messages -> messages.addErrorsLoginError(GLOBAL), () -> {
|
|
|
|
- return asHtml(path_Login_IndexJsp);
|
|
|
|
- });
|
|
|
|
|
|
+ throwValidationError(messages -> messages.addErrorsLoginError(GLOBAL), () -> asIndexPage(form));
|
|
}
|
|
}
|
|
return redirect(getClass());
|
|
return redirect(getClass());
|
|
}
|
|
}
|