def process_request(self, request):
        # Find users that are logged in but haven't been verified
        if request.user.is_authenticated() and not request.user.invite_verified:
            path = request.path_info.lstrip('/')
            # Only check the invite for paths that require login
            if not any(m.match(path) for m in EXEMPT_URLS):
                redirect_to = '%s?next=%s' % (
                    reverse('enter_invite'), request.path_info)
                return HttpResponseRedirect(redirect_to)
Validates that the invite event is authorized by a previous third-party invite.
dataset/ETHPy150Open ofa/connect/open_connect/middleware/invite.py/InviteMiddleware.process_request--crossover with--dataset/ETHPy150Open matrix-org/synapse/synapse/api/auth.py/Auth._verify_third_party_invite