I'm working to modify a cookiecutter Flask app. I'm trying to follow https://realpython.com/blog/python/handling-email-confirmation-in-flask/ to add email authorization.
My original page captures just the email. I then want to ask interested users to fill out a larger form to complete registration.
To do this I send an email that contains the email in the token and looks like:
Welcome! Please follow this link to complete registration:
http://127.0.0.1:5000/register/?token=ImNsdWVtYXJpbmUxQG1haWxpbmF0b3IuY29tIg.CafSGw.5f9hjRwQDeDWmQu4--jYVgbzezw
I then want to capture the token and complete registration doing something like:
@blueprint.route("/register/<token>", methods=['GET', 'POST'])
def register(token):
form = RegisterForm(request.form, csrf_enabled=False)
email = confirm_token(token) # decodes email from token
# look up email here and save registration info to same user object as email
if form.validate_on_submit():
However first things first and I need to capture the token. Why doesn't the link work to pass the token to the register method