Added a clear example of how to add the authentication process as middleware.