Skip to content

Rework email confirmation #38

@merwok

Description

@merwok

Issues in current email confirmation code:

if self.email_confirmation_class is None:
raise MissingSetting('email_confirmation_string')
confirmation = self.email_confirmation_class.objects.create(user=user)
if get_setting('email_confirmation_send_email', True):
email_field = user.get_email_field_name()
send_email(request, user, getattr(user, email_field), confirmation)

  1. Email confirmation should be optional (for projects that want to accept signups immediately, or validate the email with other methods). At the moment there is a setting for this, but a test fails if no EmailConfirmation class is defined (caused by Impossible to use login view without configuring signup view #11).

  2. For projects where the website (JS dynamic site) and the API have separate domain names, we can’t use routes and reverse to create the URL in the email; another function should be used to generate frontend URL (example below).

  3. Provide an API view to receive the confirmation token sent by the frontend.

  4. If confirmation fails, the user can’t sign up again with the same address. We could change signup to use get_or_create; add an endpoint to re-send the email; punt until Generate email tokens without using the database #19 is solved; something else.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions