Api key authentication
The idea is to make endpoints being able to be protected by an api key, which Next.js can use.
The authentication should have one header for global secret api key, and one header for which users is trying to access backend. Next.js will have the responsibility of authenticating users properly and then using the correct user id.