__init__.py 文件源码

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

项目:Alexandria 作者: indrora 项目源码 文件源码
def needs_authentication():
    """
    Decorator: Attach this to a route and it will require that the session has been
    previously authenticated.
    """
    def auth_chk_wrapper(f):
        # This is our decoratorated function wrapper
        @wraps(f)
        def deco(*args, **kwargs):
            # If the session does not yet have an authentication 
            if not is_authenticated():
                return redirect(sign_auth_path(request.full_path))
            else:
                return f(*args, **kwargs)
        return deco
    return auth_chk_wrapper
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号