Changeset 76ebb1b in OpenWorkouts-current for ow/utilities.py


Ignore:
Timestamp:
Feb 18, 2019, 12:54:45 PM (5 years ago)
Author:
Borja Lopez <borja@…>
Branches:
current, feature/docs, master
Children:
4af38e8
Parents:
d6da99e
Message:

(#29) Add user verification by email on signup.

From now on, when a new user signs up, we set the account into an "unverified"
state. In order to complete the signup procedure, the user has to click on a
link we send by email to the email address provided on signup.

IMPORTANT: A new dependency has been added, pyramid_mailer, so remember to
install it in any existing openworkouts environment (this is done automatically
if you use the ./bin/start script):

pip install pyramid_mailer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ow/utilities.py

    rd6da99e r76ebb1b  
    88from decimal import Decimal
    99from shutil import copyfileobj
     10from uuid import uuid4
    1011
    1112from unidecode import unidecode
     
    2021
    2122log = logging.getLogger(__name__)
     23
     24
     25def get_verification_token():
     26    """
     27    Generate a new uuid4 verification token we can give a user for
     28    verification purposes.
     29    uuid4 is a standard that generates a randomly generated token,
     30    optimized for a very low chance of collisions. But even if
     31    we had a collision, it wouldn't matter - it's simple some users
     32    getting the same token in their verification mail.
     33    """
     34    return uuid4()
    2235
    2336
Note: See TracChangeset for help on using the changeset viewer.