Hey guys, in my extension I have two Views: Dashbo...
# suitecommerce
v
Hey guys, in my extension I have two Views: Dashboard and Login Page. I want to redirect the user from Dashboard to Login Page, if the user is not logged in. I'm checking the login status via Profile Model in Dashboard's initialize() method and then redirecting the user to the Login View if they are not logged in. I've tried Backbone.history.navigate('dashboard/login', {trigger: true}); but that only updates the address bar. window.location.replace() works, but it refreshes the entire webstore (I'm not sure if that is the best practice) What is the best practice for such kind of a redirection? (Just FYI, both views are non-CMS PageTypes and the store is SC 19.1)
m
Try with this instead Backbone.history.navigate(‘whatever-your-url’, {trigger: true, replace:true})