Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Forgot password feature #1878

Closed
teosarca opened this issue Jul 13, 2018 · 10 comments
Closed

Forgot password feature #1878

teosarca opened this issue Jul 13, 2018 · 10 comments

Comments

@teosarca
Copy link
Member

teosarca commented Jul 13, 2018

Is this a bug or feature request?

FR
backend task: metasfresh/metasfresh-webui-api-legacy#1006

What is the current behavior?

Which are the steps to reproduce?

What is the expected or desired behavior?

Implement forgot password functionality as follows.

Login screen: we need the Forgot password link

image

Page: Send reset password instructions

image

In this screen user shall enter his/her email address and then press on that button to request an email with reset password link.

When user presses the button:

Page: Set the new password

In previous step, user got an email with password reset instructions.
There he/she got the password reset link which looks like:
https://w101.metasfresh.com:8443/resetPassword?token=ecde7596-7e29-4f85-81f1-502b7f84b1f7
Remark:

  • the frontend shall render the password reset page on "/resetPassword" path
  • the password reset token is provided as parameter

Using that token the frontend shall render the password reset page:

image

To fetch user's full name and email please use: http://w101.metasfresh.com:8081/swagger-ui.html#!/login-rest-controller/getResetPasswordInfoUsingGET

!!! Don't show the user eMail adress on the password change screen !!!

To fetch user's avatar please use: http://w101.metasfresh.com:8081/swagger-ui.html#!/login-rest-controller/getUserAvatarUsingGET which will return the avatar picture if available.

After user is filling the new password and he/she is retyping the new password, frontend shall validate if the new password and retyped password match. If not, it shall display the {{webui.forgotPassword.error.retypedNewPasswordNotMatch}} message and the button shall not be active.

If everything is OK, frontend shall call http://w101.metasfresh.com:8081/swagger-ui.html#!/login-rest-controller/resetPasswordCompleteUsingPOST endpoint in order to reset the password.

That endpoint might return an error (e.g. password is not valid). That error shall be shown.

In case everything is OK, the user will be logged in and the endpoint will return EXACTLY the same as http://w101.metasfresh.com:8081/swagger-ui.html#!/login-rest-controller/authenticateUsingPOST .
Frontend shall work exactly the same as on login.
If the loginComplete property is true then user is logged in and the main page shall be displayed.
If the loginComplete property si false then the "pick role screen" shall be displayed.

NOTE: internally webui messages are prefixed with webui. but when we provide them to frontend we strip out the webui. prefix. When writing this concept I forgot about that, so that's why all the messages are prefixed with webui. (see http://w101.metasfresh.com:8081/rest/api/i18n/messages?filter=forgotPassword)

@metas-mk
Copy link
Member

metas-mk commented Jul 13, 2018

w/ @teo Decided to not show the user eMail address on password change screen.

@siemiatj siemiatj self-assigned this Jul 15, 2018
siemiatj added a commit that referenced this issue Jul 19, 2018
siemiatj added a commit that referenced this issue Jul 19, 2018
- link to reset password
siemiatj added a commit that referenced this issue Jul 22, 2018
- properly get the token from params #1878
siemiatj added a commit that referenced this issue Jul 22, 2018
siemiatj added a commit that referenced this issue Jul 22, 2018
@siemiatj
Copy link
Contributor

@teosarca @metas-mk 3 things :

  1. The passcode sent message seems a bit long. Should we make it shorter, bigger button, bigger window AND button ?

screen shot 2018-07-22 at 01 37 05

  1. All the error messages come in German. Is it fixable on the backend ?

screen shot 2018-07-22 at 23 29 10

  1. What should happen if user is redirected to /resetPassword?token=<token> and the token is invalid (for instance user sent himself two codes and clicked the older one) ? Should we redirect him back to the /forgottenPassword form and show some custom message about token being invalid ? Redirect back to login ? Stay on /resetPassword and show message ?

@siemiatj
Copy link
Contributor

Forgot about the fourth thing ;) The avatar request returns JFIF data that frontend cannot really display properly using base64. Can we just get a bes64 encoded stream instead ?

@teosarca
Copy link
Member Author

@siemiatj

  1. IMHO that message shall not displayed on a button but in some div/paragraph. There is no action required from user. We are just informing the user that he/she got an email and he/she will click on the link from that email and will continue from there (in a new browser tab/window).

  2. good point. I shall use the user's language. Atm we are doing this, but after user is logged in.
    But I think it would make sense to use user's language even in this case.
    Have to think how to do it.

  3. The endpoint will fail with some error message. I think we shall show that error message to user and have a button to go back to Forgot password page.

The avatar request returns JFIF data that frontend cannot really display properly using base64. Can we just get a bes64 encoded stream instead ?

let's talk about this. But that endpoint returns a real picture same as the other image endpoints that we have returns.

@metas-Kay
Copy link
Member

Hi,
when I attempt to log in on https://w101.metasfresh.com:8443/ without Login and/or Password, I get a long error message like this:
metasfresh pw

instead of something like this:

metasfresh pw2

Not sure, if this issue exists for other instances, too. Just stumbled upon it and thought I'd mention it. (:

siemiatj added a commit that referenced this issue Aug 7, 2018
siemiatj added a commit that referenced this issue Aug 7, 2018
- link to reset password
siemiatj added a commit that referenced this issue Aug 7, 2018
siemiatj added a commit that referenced this issue Aug 7, 2018
- properly get the token from params #1878
siemiatj added a commit that referenced this issue Aug 7, 2018
siemiatj added a commit that referenced this issue Aug 7, 2018
siemiatj added a commit that referenced this issue Aug 7, 2018
siemiatj added a commit that referenced this issue Aug 8, 2018
siemiatj added a commit that referenced this issue Aug 8, 2018
siemiatj added a commit that referenced this issue Aug 8, 2018
siemiatj added a commit that referenced this issue Aug 14, 2018
metas-mk added a commit to metasfresh/metasfresh that referenced this issue Aug 22, 2018
metas-ts added a commit to metasfresh/metasfresh that referenced this issue Aug 27, 2018
[#4492](#4492) Project Status and Product Category Trl
[#4494](#4494) Projecttype Org Validation
[#4448](#4448) Advanced BLs to create inventory lines
[#4450](#4450) Tablet optimized inventory-counting-window
[#4482](#4482) Support Doctype Text templates also on purchase order
[#4498](#4498) Make fields in explicit user filter mandatory or optional
[#4501](#4501) LogicExpressionEvaluator: improve error message in case something went wrong
[#4517](#4517) Extend Sales Order REST API to support price and support all product values
[#1878](metasfresh/metasfresh-webui-frontend-legacy#1878) Forgot password feature
[#4483](#4483) Payment allocation form does not show invoices
[#4499](#4499) Cannot create letter
[#4504](#4504) Mandatory logic broken for C_FlatrateTerm.C_Currency_ID
[#4506](#4506) Compensation Group's subtotals gets broken after setting/changing the flatrate conditions
[#4509](#4509) NPE in Compensation Groups creation
[#4514](#4514) Include sales orders REST API to metasfresh-dist/serverRoot
[#1188](metasfresh/metasfresh-webui-frontend-legacy#1188) Home and End button move caret in text fields
[#1463](metasfresh/metasfresh-webui-frontend-legacy#1463) Unable to execute any quick actions in Firefox
[#1578](metasfresh/metasfresh-webui-frontend-legacy#1578) Applied filter params sometimes not displayed in filter
[#1589](metasfresh/metasfresh-webui-frontend-legacy#1589) included tab: when refreshing via websocket event the sort/order is not preserved
[#1707](metasfresh/metasfresh-webui-frontend-legacy#1707) Red line is missing when a document was not saved
[#1872](metasfresh/metasfresh-webui-frontend-legacy#1872) [alt]+u not working as before
[#1923](metasfresh/metasfresh-webui-frontend-legacy#1923) Sequence of Dropdowns in combined Business Partner Lookups not working
[#1927](metasfresh/metasfresh-webui-frontend-legacy#1927) No additional filter parameter from a dropdown selectable when filter has a default value set
@metas-dh
Copy link
Member

metas-dh commented Aug 31, 2018

Results of IT1
tested in release

  1. Forgot password link in Login Screen: OK

2.. click Forgot Password link:

  • screen opens to enter email address, in .../forgottenPassword: OK
  • email address suggested after entering the first letters: OK i think?
  1. info about email with link for resetting PW being sent (just info, not a button): OK
  2. email for resetting PW: only text, no link included?
    2018-08-31 15_11_22-einrichtung eines neuen passwortes - nachricht nur-text

@teosarca
Copy link
Member Author

@metas-dh

email address suggested after entering the first letters: OK i think?

yup, it's ok. that's ur browser...

email for resetting PW: only text, no link included?

that's might be a backend issue.... but I think it's only a config issue.
is the webui.frontend.url sysconfig set?
It shall be set to something like https://mf15adit.

@metas-dh
Copy link
Member

metas-dh commented Sep 3, 2018

is the webui.frontend.url sysconfig set?

no, it wasn't, got an email with the correct link now after setting it.. thx for the hint.

@metas-dh
Copy link
Member

metas-dh commented Sep 4, 2018

continued IT1 (in release)

  1. email for resetting PW: link included, opens /resetPassword?token site: OK
  • don't show the user eMail adress on the password change screen: OK, just the user name and user avatar were shown
  • if avatar is not available: displayed avatar OK like this?
    2018-09-04 09_14_32-metasfresh
  1. add a new PW twice, OK:
  • if new password and retyped password don't match:
    • "Retyped new password does not match.": OK
    • button for logging in not active: OK
  • new password and retyped password match:
    • loginComplete property is true then user is logged in and the main page shall be displayed: OK
    • loginComplete property is false then the "pick role screen" shall be displayed: OK
  • if new PW was set already and user is logged in: "Verbindungsproblem" and error msg: "Server error, User already logged in": OK
  1. token is invalid (for instance user sent himself two codes and clicked the older one) =>The endpoint will fail with some error message. I think we shall show that error message to user and have a button to go back to Forgot password page:
  • i tried that testcase, with sending two codes and using the older one, but that worked fine; is that OK?
  1. language shall use the user's language: had de_DE set for my user, but the language in the resetting PW process was mostly en_US: NOK i think

  2. reset PW not matching the usual PW requirements, e.g. too short (tried with only 4 letters): just showed "Verbindungsproblem", but no info about PW being invalid bc of length: NOK i think

@teosarca pls let me know if i forgot to test anything

@metas-dh
Copy link
Member

metas-dh commented Sep 6, 2018

created follow ups for the NOKs (see above):
metasfresh/metasfresh-webui-api-legacy#1038
metasfresh/metasfresh-webui-api-legacy#1039

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants