refactored authentication to a custom middleware class