use of org.codelibs.fess.app.web.base.login.LocalUserCredential in project fess by codelibs.
the class LoginAction method login.
@Execute
public HtmlResponse login(final LoginForm form) {
validate(form, messages -> {
}, () -> asIndexPage(form));
verifyToken(() -> asIndexPage(form));
final String username = form.username;
final String password = form.password;
form.clearSecurityInfo();
try {
final HtmlResponse loginRedirect = fessLoginAssist.loginRedirect(new LocalUserCredential(username, password), op -> {
}, () -> {
activityHelper.login(getUserBean());
userInfoHelper.deleteUserCodeFromCookie(request);
return getHtmlResponse();
});
if (ComponentUtil.getFessConfig().isValidAdminPassword(password)) {
return loginRedirect;
}
getSession().ifPresent(session -> session.setAttribute(INVALID_OLD_PASSWORD, password));
return asHtml(virtualHost(path_Login_NewpasswordJsp));
} catch (final LoginFailureException lfe) {
activityHelper.loginFailure(OptionalThing.of(new LocalUserCredential(username, password)));
throwValidationError(messages -> messages.addErrorsLoginError(GLOBAL), () -> asIndexPage(form));
}
return redirect(getClass());
}
Aggregations