Basic Auth vs /api/auth/login

Iā€™m using headless kirby with a Nuxt Frontend(GitHub - johannschopplich/kirby-nuxt-starterkit: šŸ’š Kirby's sample site ā€“ ported to Nuxt 3 and KirbyQL) and I got basic auth (with a test string) as well as auth/login with username/password running.

My project will have a public area (where I use the basic auth to protect the api) and a profile page where users need to be logged in.

What is the correct way to do this? Should I send a request to api/auth/login and if it succeeds, use the basic auth combination of username/password for getting restricted content? How does the session lifecycle look here? Can a user be passed to api requests?