-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Issues in current email confirmation code:
rest-framework-auth-toolkit/rest_auth_toolkit/views.py
Lines 51 to 57 in e7a2319
| 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) |
-
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).
-
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).
-
Provide an API view to receive the confirmation token sent by the frontend.
-
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.