jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.47k stars 4.02k forks source link

Request reset password no show message if the mail don't exist #6277

Closed setterlee closed 7 years ago

setterlee commented 7 years ago
Overview of the issue

When a user try the reset his password and insert a wrong email, the application don't show the message for wrong email.

Motivation for or Use Case

the "password reset init component" is evaluating the "response.message" to validate if it's equal to the string "email address not registered" but the message come as the messages body. (message._body)

Reproduce the error

Just try to reset the password for a wrong email.

Related issues

I didn't found some similar case reported

Suggest a Fix

change the statement from this:

if (response.status === 400 && response.message === 'email address not registered')

to this:

if (response.status === 400 && response._body === 'email address not registered')

in the line 38 of password-reset-init.component.ts

that works for me

JHipster Version(s)

4.6.2

JHipster configuration
JHipster Version(s)
s-medic-soft@0.0.0 /Users/setterlee/Development/workspaces/IdeaProjects/sMedicSoftV2
├── generator-jhipster@4.6.2 
└─┬ generator-jhipster-entity-audit@2.5.1
  └── generator-jhipster@4.6.2  deduped
JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "cl.stechsolutions.smedicsoft",
      "nativeLanguage": "es"
    },
    "jhipsterVersion": "4.6.2",
    "baseName": "sMedicSoft",
    "packageName": "cl.stechsolutions.smedicsoft",
    "packageFolder": "cl/stechsolutions/smedicsoft",
    "serverPort": "8080",
    "authenticationType": "jwt",
    "hibernateCache": "ehcache",
    "clusteredHttpSession": false,
    "websocket": "spring-websocket",
    "databaseType": "sql",
    "devDatabaseType": "postgresql",
    "prodDatabaseType": "postgresql",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": false,
    "buildTool": "gradle",
    "enableSocialSignIn": true,
    "jwtSecretKey": "replaced-by-jhipster-info",
    "clientFramework": "angularX",
    "useSass": false,
    "clientPackageManager": "yarn",
    "applicationType": "monolith",
    "testFrameworks": [
      "gatling",
      "cucumber",
      "protractor"
    ],
    "jhiPrefix": "jhi",
    "enableTranslation": true,
    "nativeLanguage": "es",
    "languages": [
      "es",
      "en",
      "fr"
    ]
  },
  "generator-jhipster-entity-audit": {
    "auditFramework": "custom"
  }
}
Environment and Tools

java version "1.8.0_141" Java(TM) SE Runtime Environment (build 1.8.0_141-b15) Java HotSpot(TM) 64-Bit Server VM (build 25.141-b15, mixed mode)

git version 2.11.0 (Apple Git-81)

node: v8.2.1

npm: 5.3.0

bower: 1.8.0

gulp: [17:01:02] CLI version 1.3.0

yeoman: 2.0.0

yarn: 0.27.5

Docker version 17.06.0-ce, build 02c1d87

docker-compose version 1.14.0, build c7bdf9e

Entity configuration(s) entityName.json files generated in the .jhipster directory

the entity configuration is no relevant for this issue

Browsers and Operating System

macOS Sierra 10.12.6

jdubois commented 7 years ago

I confirm the issue, I have the same one in https://start.jhipster.tech/ !