I use Vue.js on frontend and GoLang on backend. With Vue I'm sending AJAX request with credentials for sign in/sign up. Should I use HTTP Basic Auth, or just send them in request body? In case you are wondering, I'm using HTTPS. After the initial request, I'm sending back a session cookie, which I will use for successive requests.
Don't use Basic authentication, it's an old authentication scheme that provides no benefit over cookie or token based session management. When using basic authentication credentials serve as a session identifier, therefore needs to be sent in every request. This has two big downsides:
Credentials are stored in the browser's cache in plaintext which may be abused in some scenarios
Session can not be terminated as it's attached to user credentials and credentials have no concept of expiracy as JWT, cookies or other kind of tokens have (Note: When saying expiracy I'm not referring to password expiracy as in "Need to change password every 3 months" but credentials as an authentication scheme)
Even if you attempt to use basic authentication to then send a session cookie browsers will keep sending the credentials in the authorization header.
If you're using AJAX requests my advice would be to stick with cookie based authentication or migrate to JWT. Note that if the API is being called from a different hostname (f.e. www.example.com calls an api in api.example.com), the corresponding CORS headers to allow credentials should be properly set