Refactored authentication logic and request handler decorator registration.