Express middleware for authentication and security constraints