Move signin to use AJAX. Render all flask templates with the common header. Move the header to a partial. Add account recovery.

This commit is contained in:
yackob03 2013-10-14 17:50:07 -04:00
parent e182163d34
commit 4c15072c5a
17 changed files with 653 additions and 617 deletions

View file

@ -5,16 +5,37 @@ from app import mail, app
CONFIRM_MESSAGE = """
This email address was recently used to register the username '%s'
at <a href="https://quay.io">Quay</a>.<br>
at <a href="https://quay.io">Quay.io</a>.<br>
<br>
To confirm this email address, please click the following link:<br>
<a href="https://quay.io/confirm?code=%s">https://quay.io/confirm?code=%s</a>
"""
RECOVERY_MESSAGE = """
A user at <a href="https://quay.io">Quay.io</a> has attempted to recover their account
using this email.<br>
<br>
If you made this request, please click the following link to recover your account and
change your password:
<a href="https://quay.io/recovery?code=%s">https://quay.io/recovery?code=%s</a><br>
<br>
If you did not make this request, your account has not been compromised and the user was
not given access. Please disregard this email.<br>
"""
def send_confirmation_email(username, email, token):
msg = Message('Welcome to Quay! Please confirm your email.',
msg = Message('Welcome to Quay.io! Please confirm your email.',
sender='support@quay.io', # Why do I need this?
recipients=[email])
msg.html = CONFIRM_MESSAGE % (username, token, token)
mail.send(msg)
def send_recovery_email(email, token):
msg = Message('Quay.io account recovery.',
sender='support@quay.io', # Why do I need this?
recipients=[email])
msg.html = RECOVERY_MESSAGE % (token, token)
mail.send(msg)