Adding fotgot password functionality
This commit is contained in:
committed by
Caleb Forbes Davis V
parent
ad56a4826b
commit
25ba955e20
@@ -92,3 +92,18 @@ def mediaentry_add_fail_error_and_metadata(database):
|
||||
{'fail_metadata': {'$exists': False}},
|
||||
{'$set': {'fail_metadata': {}}},
|
||||
multi=True)
|
||||
|
||||
|
||||
@RegisterMigration(6)
|
||||
def user_add_forgot_password_token_and_expires(database):
|
||||
"""
|
||||
Add token and expiration fields to help recover forgotten passwords
|
||||
"""
|
||||
database['users'].update(
|
||||
{'fp_token': {'$exists': False}},
|
||||
{'$set': {'fp_token': ''}},
|
||||
multi=True)
|
||||
database['users'].update(
|
||||
{'fp_token_expire': {'$exists': False}},
|
||||
{'$set': {'fp_token_expire': ''}},
|
||||
multi=True)
|
||||
|
||||
@@ -78,6 +78,8 @@ class User(Document):
|
||||
'url' : unicode,
|
||||
'bio' : unicode, # May contain markdown
|
||||
'bio_html': unicode, # May contain plaintext, or HTML
|
||||
'fp_token': unicode, # forgotten password verification key
|
||||
'fp_token_expire': datetime.datetime
|
||||
}
|
||||
|
||||
required_fields = ['username', 'created', 'pw_hash', 'email']
|
||||
|
||||
Reference in New Issue
Block a user