Check for valid UUID in user authentication middleware