Search code examples
typescriptasp.net-corevue.jsidentityserver4server-side-rendering

Vue Js Authentication with keeping same url for home component and login component


How can I implement authentication with keeping URL same in browser as facebook does?

If user is authenticated, it shows home page, if not, it shows login page. But in both case URL is same.

How can I achieve that using Vue js.

I don't want to keep home page html at client side if not authenticated (might be server side rendering will require for this scenario).

I have used asp.net core, identity server 4, typescript, webpack in project.


Solution

  • Following thread might help. It has different solutions.

    https://github.com/vuejs/vue-router/issues/76