This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit dc466a52d08810cf243f5da395f66f33ff78b751 Author: Kevin Morin <morin@codelutin.com> Date: Tue Jul 18 11:25:47 2017 +0200 fxes #68 message d'erreur différent si le compte n'est pas validé --- .../chorem/pollen/rest/api/PollenRestApiApplication.java | 2 ++ .../PollenEmailNotValidatedExceptionMapper.java | 15 +++++++++++++++ pollen-ui-riot-js/src/main/web/i18n.json | 2 ++ pollen-ui-riot-js/src/main/web/tag/SignIn.tag.html | 9 +++++---- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/PollenRestApiApplication.java b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/PollenRestApiApplication.java index f4372e95..d7fa862c 100644 --- a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/PollenRestApiApplication.java +++ b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/PollenRestApiApplication.java @@ -7,6 +7,7 @@ import org.chorem.pollen.rest.api.exceptionMappers.FavoriteListImportExceptionMa import org.chorem.pollen.rest.api.exceptionMappers.InvalidEntityLinkExceptionMapper; import org.chorem.pollen.rest.api.exceptionMappers.InvalidFormExceptionMapper; import org.chorem.pollen.rest.api.exceptionMappers.PollenAuthenticationExceptionMapper; +import org.chorem.pollen.rest.api.exceptionMappers.PollenEmailNotValidatedExceptionMapper; import org.chorem.pollen.rest.api.exceptionMappers.PollenInvalidEmailActivationTokenExceptionMapper; import org.chorem.pollen.rest.api.exceptionMappers.PollenInvalidPermissionExceptionMapper; import org.chorem.pollen.rest.api.exceptionMappers.PollenInvalidSessionTokenExceptionMapper; @@ -56,6 +57,7 @@ public class PollenRestApiApplication extends Application { new PollenUnauthorizedExceptionMapper(), new PollenInvalidPermissionExceptionMapper(), new PollenInvalidEmailActivationTokenExceptionMapper(), + new PollenEmailNotValidatedExceptionMapper(), new InvalidFormExceptionMapper(), new FavoriteListImportExceptionMapper(), new TopiaNoResultExceptionMapper(), diff --git a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/exceptionMappers/PollenEmailNotValidatedExceptionMapper.java b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/exceptionMappers/PollenEmailNotValidatedExceptionMapper.java new file mode 100644 index 00000000..e5e2caaa --- /dev/null +++ b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/exceptionMappers/PollenEmailNotValidatedExceptionMapper.java @@ -0,0 +1,15 @@ +package org.chorem.pollen.rest.api.exceptionMappers; + +import org.chorem.pollen.services.service.security.PollenEmailNotValidatedException; + +import javax.ws.rs.core.Response; + +/** + * @author Sylvain Bavencoff - bavencoff@codelutin.com + */ +public class PollenEmailNotValidatedExceptionMapper extends PollenAbstractExceptionMapper<PollenEmailNotValidatedException> { + + public PollenEmailNotValidatedExceptionMapper() { + super(Response.Status.FORBIDDEN); + } +} diff --git a/pollen-ui-riot-js/src/main/web/i18n.json b/pollen-ui-riot-js/src/main/web/i18n.json index 8f847fa7..065046a0 100644 --- a/pollen-ui-riot-js/src/main/web/i18n.json +++ b/pollen-ui-riot-js/src/main/web/i18n.json @@ -199,6 +199,7 @@ "signin_lostpassword": "Mot de passe perdu ?", "signin_connexion": "Se connecter", "signin_error_signin": "Courriel ou de mot de passe invalide", + "signin_error_signinemailNotValidated": "Vous devez valider votre compte avant de pouvoir vous connecter. Relevez vos emails, nous vous avons envoyé un lien de validation.", "newpassword_title": "Obtenir un nouveau mot de passe", "newpassword_action": "Envoyer", "newpassword_placeholder": "Entrez votre courriel", @@ -710,6 +711,7 @@ "signin_lostpassword": "Lost password?", "signin_connexion": "Connect", "signin_error_signin": "Email or password invalid", + "signin_error_signinemailNotValidated": "You must validate your account before connecting. Check your emails, we sent you an activation link.", "newpassword_placeholder": "Fill your email", "newpassword_title": "Get a new password", "newpassword_action": "Send password", diff --git a/pollen-ui-riot-js/src/main/web/tag/SignIn.tag.html b/pollen-ui-riot-js/src/main/web/tag/SignIn.tag.html index f4cdc57c..cc98c8a9 100644 --- a/pollen-ui-riot-js/src/main/web/tag/SignIn.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/SignIn.tag.html @@ -85,7 +85,6 @@ require("./components/HumanInput.tag.html"); }; this.close = () => { - this.logger.log("close !"); this.openSignIn = false; this.update(); }; @@ -100,9 +99,11 @@ require("./components/HumanInput.tag.html"); .then(() => { this.openSignIn = false; this.update(); - }, () => { - this.message = this.__.error_signin; - this.update(); + }, (response) => { + response.text().then(error => { + this.message = this.__["error_signin" + error]; + this.update(); + }); }); }; </script> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.