Beefing up the auth callback function.