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
|
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
|
||||||
|
|||||||
5
pom.xml
5
pom.xml
@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user