

@app.route('/auth', methods=['GET'])
def handleAuth():
    app.logger.info(('handleAuth [%s]' % request.method))
    result = False
    if (db is not None):
        token = request.args.get('token')
        if (token is not None):
            me = db.get(('token-%s' % token))
            if me:
                data = db.hgetall(me)
                if (data and (data['token'] == token)):
                    result = True
    if result:
        return ('valid', 200)
    else:
        session.pop('indieauth_token', None)
        session.pop('indieauth_scope', None)
        session.pop('indieauth_id', None)
        return ('invalid', 403)

dataset/ETHPy150Open bear/python-indieweb/indieweb.py handleAuth/original