Refactored auth success handler