import bcrypt
import random
+from mediagoblin import mg_globals
+from mediagoblin.tools.crypto import get_timed_signer_url
+from mediagoblin.tools.mail import send_email
+from mediagoblin.tools.template import render_template
+
def bcrypt_check_password(raw_pass, stored_hash, extra_salt=None):
"""
.dumps(user.id)
rendered_email = render_template(
- request, 'mediagoblin/auth/fp_verification_email.txt',
+ request, 'mediagoblin/plugins/basic_auth/fp_verification_email.txt',
{'username': user.username,
'verification_url': EMAIL_FP_VERIFICATION_TEMPLATE.format(
- uri=request.urlgen('mediagoblin.auth.verify_forgot_password',
+ uri=request.urlgen('mediagoblin.plugins.basic_auth.verify_forgot_password',
qualified=True),
fp_verification_key=fp_verification_key)})
[user.email],
'GNU MediaGoblin - Change forgotten password!',
rendered_email)
-
# check if user active and has email verified
if user.email_verified and user.status == 'active':
- cp_form = forms.ChangePassForm(formdata_vars)
+ cp_form = forms.ChangeForgotPassForm(formdata_vars)
if request.method == 'POST' and cp_form.validate():
user.pw_hash = tools.bcrypt_gen_password_hash(
'notthepassword', hashed_pw, '3><7R45417')
-def test_change_password(self, test_app):
+def test_change_password(test_app):
"""Test changing password correctly and incorrectly"""
test_user = fixture_add_user(password=u'toast')