Server: NodeJS (Express, Passport and MongoStore for middleware) Client: VueJS and Vue Router
Background
I have noticed that whenever changing hash location with Vue Router, it sends a GET request to the server on the root path. For example navigating from /app#/route1 to /app#/route2 (using either router.go() or <router-link>) will send a GET request to /app.
On my server routing logic, the route of the app is authenticated using Express/Passport/MongoStore so as to ensure user is logged in. If doing a full page load or refresh, the response will redirect user to login screen if not authenticated, but when Vue Router sends the request, the authentication has no effect whatsoever, neither will res.render or res.redirect. (so if client logs out in a second tab, the first tab can still navigate menus on the first tab except that no data will populate the pages since AJAX and SocketIO data requests will be separately authenticated).
The key difference of course between a Vue Router GET and a full page GET is that "text/html" won't be shown in the Accept request headers, among other things. At the moment the server responds with Res.render for all GET requests, but for Vue Router navigations this is redundant. On top of this the server also makes some updates in MongoDb to setup some environmentals for the Application, but this is unnecessary every time the user navigates pages on the client side only, it is only necessary on page load.
Although I could alter some server side logic to skip some steps when text/html is not included in req.headers.accept, the middleware is still doing unnecessary authentication each time the user navigates and I cannot see an immediate security benefit to doing so.
Question Is it possible to configure Vue Router so as to not send requests every time it changes hash location?