aspnetcore-vuetify-universal icon indicating copy to clipboard operation
aspnetcore-vuetify-universal copied to clipboard

SSR initial controller request life cycle

Open rwfresh opened this issue 6 years ago • 0 comments

@ElderJames hey thanks so much for this. I really appreciate it. All of this is quite new to me so I am wondering if you could answer a question or two for me. I'm trying to understand the general life cycle of an Server Side Rendered Vue app using asp.net core. Does this look correct to you?

Client makes a page request to .Net Core controller/API action A prerenderer call is made from the controller action to a .js file on the server I am really not clear what happens in the renderOnServer.js file other than I see an INITIAL_STATE is set that is then applied in the entry.js. I am using .net Core Identity cookie authentication. And so on the initial request of my app I return the app payload and the first thing that happens is the Vuex store makes a call back to the server to see if the user is authenticated. if they are they are pushed to the requested route. If not they are pushed to the login. Ideally I can avoid this and do it on the server. I'm not quite understanding how this works with SSR. Will node/nodeservices execute an api call like in my case (isAuthenticated)? Is there some way to return a state object from the first controller call that can be passed directly to client bundle or serverbundle?? Or can NodeServices make those api calls?

rwfresh avatar Jul 12 '18 20:07 rwfresh