def __call__(self, environ, start_response):
                
        request = Request(environ)
        auth = request.authorization

        if not auth or not self.allows(username=auth.username, password=auth.password):
            return self.authenticate()(environ, start_response)
        else:
            environ["user"] = self.usermap[auth.username]
            return self.app(environ, start_response)
Accessing the view with regular user should render the page.
dataset/ETHPy150Open marchon/Flask-API-Server/apiserver/authentication.py/AuthenticationMiddleware.__call__--crossover with--dataset/ETHPy150Open ExCiteS/geokey/geokey/users/tests/test_views.py/UserProfileTest.test_get_with_regular_user