[Security] made it possible to override the default success/failure handler