feat: Change password from account settings#2751
feat: Change password from account settings#2751Sollace wants to merge 9 commits intocinnyapp:devfrom
Conversation
…s design, hide the section if the option is disabled
…if the homeserver doesn't allow changing password
|
I understand the code a little better now and I... don't like how it's handling UIA. Basically it tries to do the password change, fails, then uses the authData it got back to then show a proper auth dialog to the user. This is kind of hacky and I can't seem to find any way to do it properly. (i.e. ask for the auth flows, authenticate, and then let them change password) |
|
Hello there. Although that feels wrong, I believe that's the proper way to handle password changes according to the matrix spec. Looking at ChangePassword.tsx from Element Web, I believe their implementation is actually incorrect according to the spec. Their client assumes the server wants I guess for most deployments this behavior is fine, but I avoided it in my original implementation. Really this wouldn't be a problem if the endpoint for changing passwords had a preflight endpoint like login does. Now I do understand there's a security reason why there isn't one, which I won't go in detail. That's just the way it had to be implemented on the server side. |
Alright thanks for the extra details! I do still think it would be better if there was a way to get the methods first so we could include the password field in the main form (and then show other auth methods after. i.e. submit current pass+new pass+confirm pass, then do OTP or OAuth after) but like you said, if the only way to do that is with a preflight endpoint which we don't have then I suppose we don't have any choice. As it is then I think it's okay to mark for review and we can find any other issues from there. |
|
Preview: https://2751--pr-cinny.netlify.app |
Description
I am reviving the PR from #2419. I'd like to thank @thmasq for their contribution. Using that as the base I have:
Mind I haven't yet fully tested this as I don't want to go fussing around with my actual account. I'm going to test it properly on a throwaway before I mark this as ready to review.
Fixes #2417
Some nice to haves that could be added onto this:
Type of change
Checklist: