I am following the instructions here to have my flow inside my visualforce page render in lightning by embedding an aura component. I want to redirect the flow at finish to another visualforce page. This page mentions it's possible to redirect to another page but doesn't show me how for a VFpage. I made an output variable in my flow called "outputVar" and set the default value to "redirect". That didn't work. When I preview the VF page it goes through the flow, but doesn't redirect.
<apex:page >
<html>
<head>
<apex:includeLightning />
</head>
<body class="slds-scope">
<div id="flowContainer" />
<script>
var statusChange = function (event) {
if(event.getParam("status") === "FINISHED") {
// Control what happens when the interview finishes
var outputVariables = event.getParam("outputVariables");
var outputVar;
for(var i = 0; i < outputVariables.length; i++) {
outputVar = outputVariables[i];
if(outputVar.name === "redirect") {
var urlEvent = $A.get("e.force:navigateToURL");
urlEvent.setParams({
"url": "/jrsl_ul_unsubscribefinish"
});
urlEvent.fire();
}
}
}
};
$Lightning.use("c:campPrefCenterApp", function() {
// Create the flow component and set the onstatuschange attribute
$Lightning.createComponent("lightning:flow", {"onstatuschange":statusChange},
"flowContainer",
function (component) {
component.startFlow("jrsl_Unsubscribe_Link")
}
);
});
</script>
</body>
</html>
</apex:page>