middlewares.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:IntegraTI-API 作者: discentes-imd 项目源码 文件源码
def encrypt_password():
    """
    Verify if the route is for password reset or user create, then encrypts the password.
    """
    if request.json is None or not 'password' in request.json:
        return
    if str(request.url_rule) == '/auth/user/' and request.method == 'POST' \
    or str(request.url_rule) == '/auth/user/resetpassword/' and request.method == 'PUT':
        request.json['password'] = generate_password_hash(request.json['password'])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号