upgraded to shiro 1.4.0
enhanced error messages
This commit is contained in:
@ -63,10 +63,14 @@ public class LoginView implements Serializable {
|
||||
String fallbackUrl = "/web/index.xhtml"; // TODO make configurable
|
||||
// ec.redirect(url);
|
||||
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
|
||||
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");
|
||||
|
||||
AccountEntity account = accountService.getAccountEntity(username, false);
|
||||
@ -96,7 +100,7 @@ public class LoginView implements Serializable {
|
||||
boolean passwordResetted = accountService.resetPassword(username, password, resetPasswordToken);
|
||||
if (passwordResetted) {
|
||||
// TODO add email notification on updated user account
|
||||
FacesUtil.addInfoMessage ("Password resetted");
|
||||
FacesUtil.addInfoMessage("Password resetted");
|
||||
return login();
|
||||
} else {
|
||||
// TODO add email notificaton on failed password reset
|
||||
|
||||
5
pom.xml
5
pom.xml
@ -44,7 +44,6 @@
|
||||
<freemarker.version>2.3.24-incubating</freemarker.version>
|
||||
<pdfbox.version>2.0.2</pdfbox.version>
|
||||
<gson.version>2.7</gson.version>
|
||||
<shiro.version>1.3.2</shiro.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
@ -110,12 +109,12 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.shiro</groupId>
|
||||
<artifactId>shiro-core</artifactId>
|
||||
<version>${shiro.version}</version>
|
||||
<version>1.4.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.shiro</groupId>
|
||||
<artifactId>shiro-web</artifactId>
|
||||
<version>${shiro.version}</version>
|
||||
<version>1.4.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax</groupId>
|
||||
|
||||
Reference in New Issue
Block a user