I build a SPA with Craft CMS and Vue. I use Vue Router and have three Props. Here is my current router-view:
<router-view
csrfName="{{craft.app.config.general.csrfTokenName}}"
csrfToken="{{craft.app.request.csrfToken}}"
userID="{{currentUser.id}}"
/>
I build a user form which works perfect, but it would be great to get the loggedIn userID in the response or via GraphQL. With GraphQL we would have the advantage to check on every site if the user is still signed in
My log-in template looks the same like above but without the UserID. At the moment I make a hard redirect to my application with the userID because I can't get the data from GraphQL. That means I need to reload the whole page just to get the loggedIn userID. This isn't best practice.
Have someone a idea how I could solve this?