imhere.py 文件源码

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

项目:coms4156_jumpstart 作者: keirl 项目源码 文件源码
def manage_session():
    # want to go through oauth flow for this route specifically
    # not get stuck in redirect loop
    if request.path == '/oauth/callback':
        return

    # allow all users to visit the index page without a session
    if request.path == '/' or request.path == '/oauth/logout':
        return

    # validate that user has valid session
    # add the google user info into session
    if 'credentials' not in flask.session:
        flask.session['redirect'] = request.path
        return flask.redirect(flask.url_for('oauth2callback'))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号