shout icon indicating copy to clipboard operation
shout copied to clipboard

front-end-password-change capability

Open lucyllewy opened this issue 8 years ago • 15 comments

  • refactor clientManager.js to allow configuration parsing as a serparate function.
  • refactor clientManager.js to add configuration writing function.
  • add new plugin for /setpass command.
  • add server.js changes to allow for new "profile" screen
  • add password change ui to "profile" screen
  • modify css, front-end shout.js and index.html to add "profile" ui
  • refactor client.js to use new clientManager functionality for saving the configuration files

fixes #359

lucyllewy avatar Oct 01 '15 03:10 lucyllewy

If we are making a GUI for the password changing, why also make a command. I think when you use a / command, it is expected that it's a command being sent to the connected server.

floogulinc avatar Oct 01 '15 13:10 floogulinc

If we are making a GUI for the password changing, why also make a command.

Because some prefer commands, others GUI, best of both worlds :-)

I think when you use a / command, it is expected that it's a command being sent to the connected server.

The /clear command, already implemented is not sent to IRC server. For myself, I'm not against having / commands that are not mapped to IRC protocol command. After all, the use of "/" commands is a bare convention, not the IRC protocol.

@diddledan thanks for your patch, I will get a review at it later (quite big patch !)

I have two remarks already:

  • I would tend to prefer separating iso-functional refactorings into dedicated commits, for better readability (same PR is fine), but others may disagree, we never talked about it @astorije ? @erming ?
  • Generally in password change interfaces, you have to provide your old password as well, and it's a good thing, cause if someone "steals your seat", it cannot change your password, at least.

JocelynDelalande avatar Oct 05 '15 12:10 JocelynDelalande

@diddledan, thanks a lot for your contribution! Could you rebase this and make sure that the CI passes?

@JocelynDelalande, it looks like you have already taken a look at this, so I'm going to add you as first reviewer, and then I'll happily take over for second review when you are happy. Hopefully @diddledan can get back to your remarks and we can have this in Shout :-)

astorije avatar Nov 23 '15 00:11 astorije

I would tend to prefer separating iso-functional refactorings into dedicated commits, for better readability (same PR is fine), but others may disagree, we never talked about it @astorije ? @erming ?

I generally agree, but what refactoring are you talking about here? It's true that this is a big PR, and splitting changes in commits will help with reviews as well as future code reads.

Generally in password change interfaces, you have to provide your old password as well, and it's a good thing, cause if someone "steals your seat", it cannot change your password, at least.

Yes, let's have that on Shout too!

astorije avatar Nov 23 '15 00:11 astorije

ok, I think that I've addressed the main issue of having the old password be required before changing the password to prevent hot-seat attacks. Travis also now passes - there are a few places in the refactoring that I mentioned where the try{}catch{} blocks are in the wrong function now that the contents have been moved to individual reusable functions. (specifically in client.updateUser and client.loadUser IIRC)

lucyllewy avatar Nov 23 '15 18:11 lucyllewy

@diddledan Thanks for taking care.

I tested it, and well... it works, that's for sure :-)

We're getting better and better !

(I haven't done code review yet)

Some change still have to be done IMHO, from user point-of-view:

  • [x] the form is a bit messy-looking, if you need some inspiration, the "connect to network" page is a nicely organized form
  • [x] same applies for the message on successful change or error, it's not nicely fitting the UI nicely, what would you think about using bootstrap alerts ?
  • [x] clear form after submit (wether it's error or success)

and on a meta (but important) side:

  • [x] The git history is still too chatty: we don't want style commit like e8b92c39e23226ea2bebbe26a6eec98271e67dce or 7d51a33396c8ce46210e8a2ec31396eff7232071 in the git history. Just squash those modifications with the commit where the original mistake was made.
  • [x] conform the commit naming guidelines, I'm speaking for example about "per comments on pull request #506, I've added the requirement for the current password to be specified" which first line would better be something like "Require old password on password change form"

By the way, I prefer rebasing over merging, but I don't want to make it too difficult, so let's say merging is ok for this one (I'm speaking about 34aa52b).

JocelynDelalande avatar Dec 01 '15 22:12 JocelynDelalande

@diddledan sorry for huge delay on my side, good to see things that changes, password change UI is way better as you changed it :-)

For git history, several commits (with some containing several of your first-try commits) would have been better and clearer, but one commit is better than the handful that existed in your first try, so I'm ok with thig git history :-)

Two issues remain, that I left unchecked in my previous message, and another appeared:

  • [x] no feedback at all on UI, wether it's a success or failure

JocelynDelalande avatar Jan 08 '16 13:01 JocelynDelalande

@diddledan bump ?

JocelynDelalande avatar Jan 25 '16 11:01 JocelynDelalande

sorry about the delay. The alert dialogs now work correctly. Still need to clear the form after submittal though.

lucyllewy avatar Feb 01 '16 18:02 lucyllewy

@diddledan cool, getting close :)

JocelynDelalande avatar Feb 02 '16 17:02 JocelynDelalande

@diddledan gentle bump ? :)

JocelynDelalande avatar Feb 16 '16 15:02 JocelynDelalande

thanks for the reminder. I thought I'd committed and pushed, but it turns out I did neither :-p The latest commit from a moment ago should fix the remaining issue (clearing the fields after submittal).

lucyllewy avatar Feb 16 '16 17:02 lucyllewy

@diddledan perfect :)

:+1:

Waiting for another review here to merge.

@diddledan Final touch : would-you please mind :

  • squashing commits into one
  • submiting the same PR to lounge (which is community fork of shout)

Thanks by advance

side-note : I will no longer be active on shout master, in favor of lounge once PRs I started taking of are done

JocelynDelalande avatar Feb 16 '16 23:02 JocelynDelalande

done.

lounge pr is thelounge/lounge#57

lucyllewy avatar Feb 17 '16 00:02 lucyllewy

ok, as others commented on https://github.com/thelounge/lounge/pull/57, I will continue discussion there.

(sadly, I have been too quick giving my :+1:)

JocelynDelalande avatar Feb 17 '16 08:02 JocelynDelalande