Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let managers reset user's password #2548

Conversation

iagirre
Copy link

@iagirre iagirre commented Mar 23, 2018

References

This is a backport of the issue #2500 (done first at Madrid's fork).
The original PR is: AyuntamientoMadrid#1370

Objectives

Let the manager change the users' password in two ways:

Send an email to the registered email so that the user can be able to change the password by themselves.
Change the password using a form. The manager can write it in plain text or generate a random value.
When the password is saved, the manager can print it for the user.

Visual Changes

  • The new submenu and the overview
    password01

  • Random password generator and show/hide password
    password02_2

  • Password saved and print password page
    password03

  • How password is printed
    password04

Notes

I know that the 'Change user' link is still unchanged, but there is another PR waiting for merge that modifies that link. When both PR are merged the link will appear red and in the bottom of the box (I said this in order to avoid conflics when both PR will be merged, but If I should also change the link, let me know and I will).

@bertocq
Copy link
Collaborator

bertocq commented Mar 23, 2018

@iagirre can you fix the failing spec at /spec/features/management/account_spec.rb:15 ? The solution in raul's PR will do fine. So we can merge this one straight away without waiting any longer for his PR to be completed

iagirre added 3 commits April 2, 2018 09:43
The tests that will check the featute
is working well added. There are four test:

1. Checks that the emails are been send to
the user. The test looks for the link in there
and takes the token. Visits the page and
changes the password.

2 and 3. Both change the password by hand. One
uses a password written by the manager, whilst
the other uses the 'Generate random password'
option. Both tests check that the user can
sign in with the new passwords.

4. Checks that the password can be printed
when it is saved.
A submenu has been added to the side menu's
'Edit user account' option. This submenu has
two options:

- Reset password via email: an email is send
so that the user can change their password by
themselves.
- Reset password manually: the manager has to
write the password manually (or generate a random
one).

The passwords generated by the random password
generator don't contain characters like $ or !.
It uses some capital letters, some other lower
case letters and some numbers. Ambiguous
characters like 1, l, I has been removed.
The back button when the user changes the password
(in the print password page) redirects to the
edit manually page.

The routes to access password edit pages has been added,
along with the ones to send reset password email and
reset password manually.
@iagirre iagirre force-pushed the backport-let-manager-reset-users-password branch from 8e8ab27 to e8b9135 Compare April 2, 2018 07:43
@iagirre
Copy link
Author

iagirre commented Apr 2, 2018

I fixed the spec that was failing: d84895b#diff-7f5afe0b6447090de432c81501a61459R9

Also, I changed the name because it was confusing. It was saying that the unverified users couldn't create spending proposals, but the whole spec was about editing their account, so I changed to give it a more descriptive name.

@voodoorai2000
Copy link
Member

Excellent @iagirre 👌

@voodoorai2000 voodoorai2000 merged commit 5fae3c3 into consuldemocracy:master Apr 5, 2018
@aitbw aitbw deleted the backport-let-manager-reset-users-password branch April 5, 2018 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants