Search code examples
pythonweb2py

How to change email address of user in web2py using standard auth api with username=True


I recent upgraded web2py and starting using username=True, the form returned via auth/profile no longer contains the user email address.

How can a user change email address under the standard api?


Solution

  • With or without username=True, the email address is not editable via the current Auth API (this was changed about a year ago, presumably for security reasons). For now, you'll have to implement your own email change functionality. For extra security, you might want to require password verification, and maybe send a verification email to the new address (and possibly a notification to the old address upon completion of the change).