Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

User Registration Overhaul: break down #991

@emcoding

Description

@emcoding

Continue the discussion that started in #989.
My proposal would be to first clean up the most obvious things, start building feature tests that cover all the cases/user states and user roles. Then identify if there are underlying problems left.

  1. We need to give unconfirmed users access to update their email address, while denying access to restricted areas. That should be solved with point 2) and 3).

  2. Bug: Unconfirmed users having access to restricted pages.

  1. Users should be able to update their email address, even those who did not receive a confirmation email.
  • Solved in Devise overhaul #1007
  • TODO make resending the confirmation email accessible for unconfirmed users
  • Make sure that the 'resend confirmation' messages + logic are in place.
  1. Identify and solve omissions in the abilities.
  • TODO UsersController : see PR Spring cleaning users #1006

  • TODO TeamsController : same as ^

  • TODO MailingsController

  • TODO CommentsController
    It looks like there is something missing in the authorising part of the polymorphic relations. Maybe best to see if the fixing the UsersController works before we tackle the comments.

  • (Please add other issues re: authorisation here)

  1. Write feature tests
  • TODO: add feature tests for all the user paths (including the correct messages and sending the correct confirmation mails)
  1. Separate the authentication from the authorisation.
  • TODO Use authenticate_user! (by Devise) instead of ability
  • TODO Update abilities, removing the authentication parts.
  1. Apart from all the Ability stuff, there is an underlying thingy with Devise and GH sign in and users created in the Teams form. Maybe things will be easier to maintain if we go Devise all the way. OTOH, it could be that a little cleaning up, polishing and dusting off is all that is needed. Hard to tell at this point.

  2. @klappradla 's suggestion: Ensure that the appropriate mails are being sent.

  • We are sending confirmation mails on different occasions.
    For example: When a user is created, and when a user updates their own email.
  • TODO Double check if User#update resend_confirmation only when a user's has changed their email address, not for other updates.
  • TODO Change the email confirmation mailing content to reflect that the email address has changed, and that the change needs to be confirmed. new issue Add urgency to the email confirmation message #1004
  • TODO Update the profile edit form and show view. The old email address is displayed until the new email address is confirmed. The user isn't noticed about this, and that is confusing. It looks like the change has failed. (And if they try again, a confirmation mail is sent again. And again. )
  • It seems not all mailers' sending happens in the background. Is the method send_devise_notification ever triggered at all? Needs investigation.
  1. @pgaspar suggestion: Change the flow for unconfirmed users without email address,

maybe we should redirect to a very simple form explaining you need to confirm your email, which would also allow them to edit the email. This would be a simpler single-field form, not the standard edit form.

Looks like a great plan. I'd prefer not to start with the latter, do the clean up first.

Is this a plan? Are steps missing?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions