コード例 #1
0
ファイル: views.py プロジェクト: cnicodeme/flask-bootstrap
def lost_password():
    """
    Send a one time login link to authenticate the user.
    The link will contain an Session token that can be used directly from the app.
    """
    form = LostPasswordForm.load(request)
    form.validate()

    account = Account.find_by_email(form.email.data)
    if account:
        ot = Session(account.id)
        ot.save(True)
        ot.send()

    return jsonify({
        'success': True
    })