[Security] made it possible to override the default success/failure handler (take 2)