def is_valid_token(token): user_service = UserService() user = user_service.reset_password_by_token(token) if user is None: return "" return jsonify(ok=True)
def reset_password(token): form_data = json.loads(request.data) user_service = UserService() user = user_service.reset_password_by_token(token) if user is None: return "" result = user_service.register_new_password(user, form_data) if result: return jsonify(ok=True) return ""