My problem is this.
When a user opens two tabs and goes to the same page that requires authentication it's all fine. If then he signs out in on of the tabs he obviously is redirected to the sign in page, not on the other tab, though. Which still is normal.
However, there are some functions on the page that use javascript and, if the user tries on of them he can't preform the action and there is a "sign_in.json" rendered that contains an devise error message "unauthenticated". I need to redirect the user to sign in form once this message in sent. How do I do that?