New middleware for the authentication.