Skip to content

Improve login and registration pages - #2794

Merged
Alkarex merged 8 commits into
FreshRSS:masterfrom
flusio:imp/improve-login-and-register-pages
Mar 7, 2020
Merged

Alkarex merged 8 commits into
FreshRSS:masterfrom
flusio:imp/improve-login-and-register-pages

Conversation

@marienfressinaud

Copy link
Copy Markdown
Member

I noticed a bunch of issues on the login/registration forms, causing a bad experience. I tried to address most of them in this PR.

Changes proposed in this pull request:

  • Keep the user on login page on failure
  • Show an error if username already exists
  • Check the password format in the backend
  • Return a better message if username is invalid
  • Add a title to the login page
  • Improve look of login and register pages

The last point is still WIP because I'll have to update all the themes. I'd like your feedback before going forward. It's nothing fancy: it mainly adds more space to the forms (so they can breathe and labels stay on a single line). I also changed the look of the "cancel" button back to a real link since it's its behavior. I'll change its label to "Back to home" in a future PR which will add a proper home page.

Before (tell me if you want better quality images):

before

After:

after

How to test the feature manually:

  1. Log in with a wrong password, check you stay on the login page and an error appears
  2. Check the title of the login page is prepended by "Login" (it was not set before)
  3. Try to register with an exiting username, check you stay on registration page and you get a correct error
  4. Try to register with an invalid username (e.g. with a space inside), check you get an explicit message
  5. Try to register with a bad password (less than 7 characters), check you get an error

Note you might need to edit the DOM to remove frontend restrictions on username and password formats.

Pull request checklist:

  • clear commit messages
  • code manually tested
  • unit tests written (optional if too hard)
  • documentation updated

Additional information can be found in the documentation.

@marienfressinaud marienfressinaud changed the title Imp/improve login and register pages Improve login and register pages Feb 6, 2020
@marienfressinaud marienfressinaud changed the title Improve login and register pages Improve login and registration pages Feb 6, 2020

@Frenzie Frenzie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pictures are a bit too low-res imo. No need for new ones; they're legible (if barely :-P).

It says "maximum…" (lowercase m) and "At least…" (uppercase A).

Keep the user on login page on failure

I should've done that years ago, but it only ever seems to bother me when I'm on my phone far away from a proper PC or some such and then I forget.

Comment thread app/i18n/de/user.php Resolved
Comment thread app/i18n/cz/user.php Resolved
@marienfressinaud
marienfressinaud force-pushed the imp/improve-login-and-register-pages branch from 198fa0f to 10e8f63 Compare February 7, 2020 13:59
@Alkarex Alkarex added this to the 1.16.0 milestone Feb 25, 2020
@Alkarex

Alkarex commented Feb 29, 2020

Copy link
Copy Markdown
Member

Good for me

@Frenzie Frenzie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm too, I only had those minor spelling nitpicks 👍

', nonce=' . $nonce .
', c=' . $challenge);
Minz_Error::error(403, array(_t('feedback.auth.login.invalid')), false);
Minz_Request::bad(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new code returns 200, and not 403 anymore, right? It could be good to reintroduce the 403 at some point.
Indeed, error codes are used by other systems (such as fail2ban) e.g. to detect attacts

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be exact it returns a 302. I think there's work to do on how we handle responses, and errors in particular but I didn't want to make this PR too complicated. Here I wanted to keep the users on the same URL (?c=auth&a=login) for consistency and because there's a small condition that would be skipped otherwise (nothing dramatic).

It wouldn't be too complicated to rework this part, though I'm not sure how important it is.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Alkarex
Alkarex merged commit 51edbc1 into FreshRSS:master Mar 7, 2020
@marienfressinaud
marienfressinaud deleted the imp/improve-login-and-register-pages branch April 30, 2020 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants