I am able to display sweet alert after the page refresh but I have to click on Ok button which I am getting on sweet alert to redirect the page.Please help me in this.
None of the above solutions worked for me, I had to use .then
swal({ title: 'Success!', text: message, type: 'success', confirmButtonText: 'OK' }).then(() => { console.log('triggered redirect here'); });