upgraded to shiro 1.4.0

enhanced error messages
This commit is contained in:
jomu
2017-06-15 15:20:09 +00:00
parent d90284d28c
commit 2590070958
2 changed files with 12 additions and 9 deletions

View File

@ -63,10 +63,14 @@ public class LoginView implements Serializable {
String fallbackUrl = "/web/index.xhtml"; // TODO make configurable String fallbackUrl = "/web/index.xhtml"; // TODO make configurable
// ec.redirect(url); // ec.redirect(url);
WebUtils.redirectToSavedRequest((ServletRequest) ec.getRequest(), (ServletResponse) ec.getResponse(), fallbackUrl); WebUtils.redirectToSavedRequest((ServletRequest) ec.getRequest(), (ServletResponse) ec.getResponse(), fallbackUrl);
} catch (IOException | AuthenticationException e) { } catch (IOException | AuthenticationException ex) {
// Could catch a subclass of AuthenticationException if you like // Could catch a subclass of AuthenticationException if you like
String hint = "Error while authenticating user " + username; String hint = "Error while authenticating user " + username;
LOGGER.error(hint + "Reason: " + e.toString()); if (LOGGER.isDebugEnabled()) {
LOGGER.debug(hint, ex);
} else {
LOGGER.error(hint + " Reason: " + ex.toString());
}
FacesUtil.addErrorMessage("Login failed"); FacesUtil.addErrorMessage("Login failed");
AccountEntity account = accountService.getAccountEntity(username, false); AccountEntity account = accountService.getAccountEntity(username, false);
@ -96,7 +100,7 @@ public class LoginView implements Serializable {
boolean passwordResetted = accountService.resetPassword(username, password, resetPasswordToken); boolean passwordResetted = accountService.resetPassword(username, password, resetPasswordToken);
if (passwordResetted) { if (passwordResetted) {
// TODO add email notification on updated user account // TODO add email notification on updated user account
FacesUtil.addInfoMessage ("Password resetted"); FacesUtil.addInfoMessage("Password resetted");
return login(); return login();
} else { } else {
// TODO add email notificaton on failed password reset // TODO add email notificaton on failed password reset

View File

@ -44,7 +44,6 @@
<freemarker.version>2.3.24-incubating</freemarker.version> <freemarker.version>2.3.24-incubating</freemarker.version>
<pdfbox.version>2.0.2</pdfbox.version> <pdfbox.version>2.0.2</pdfbox.version>
<gson.version>2.7</gson.version> <gson.version>2.7</gson.version>
<shiro.version>1.3.2</shiro.version>
</properties> </properties>
<dependencyManagement> <dependencyManagement>
@ -110,12 +109,12 @@
<dependency> <dependency>
<groupId>org.apache.shiro</groupId> <groupId>org.apache.shiro</groupId>
<artifactId>shiro-core</artifactId> <artifactId>shiro-core</artifactId>
<version>${shiro.version}</version> <version>1.4.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.shiro</groupId> <groupId>org.apache.shiro</groupId>
<artifactId>shiro-web</artifactId> <artifactId>shiro-web</artifactId>
<version>${shiro.version}</version> <version>1.4.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax</groupId> <groupId>javax</groupId>