how are you? I wanted to consult if there is any way that is styled, either in performance or directly as good practices, for the following: The application of the web side is with Vue js, there will also be an API to be consumed by both web and mobile applications. On the side of the Server I use Laravel.
So, what I want is to consume the API always from the web client, but first I should log in. If I log in via web, then I would need the server to return the index, which will contain the complete compilations to work with Vue, but when I want to start consuming the API, I would be missing the token (as if I had been via API with passport or any other). The Server API could be on another server than the web. Queries: .- Is it correct to log in the web server, and that it is logged in the server API? Then he will continue working against the web, and that he will use proxies to communicate with the API. That is, the web part would act as a handrail only.
.- The other one is that I loguee against the web, that it logs against the API and manages to return that token to the web client, and then start only to interact with the API. With this, they would leave the web server a bit obsolete, since I would be using it just to log in and give me all the Vue files, now.
.- The last one, is to start from the login form (that the user should get it in some way), then log in, and then get the Vue compilations to continue consuming the API. What is not clear to me, and I mean better practices to avoid wasting resources, is, in this scenario, how to get to the Login form, and more important, once logged against the API, get the full site in Vue, post that the API should not give you this kind of information, is that correct? Sorry if the query was extensive. I hope you understood what I want to do.
The query is more oriented to what is the best practice or what is styled in these cases. Thank you !! Greetings!
G.