I need to implement client-side validation to check if the user is logged in, and if not, redirect them to the sign-in page. The issue is that the sign-in page exists outside of my Backbone Marionette app. Is there a way in Marionette, Backbone, jQuery, or JavaScript to direct a user to a server-side URL while exiting the Marionette app?
The desired outcome is for users to be directed straight to localhost:3000/signin. I'm uncertain if this can be achieved with the Approuter, but I assume it's unlikely.
Here is the structure I aim to follow (using jQuery cookie to access cookies):
API =
list: ->
if $.cookie('user_id') != null
console.log "continue to marionette"
else
console.log "route to signin"
Should I move the sign-in section into my Backbone Marionette app rather than keeping it as a Rails view outside of it?