There are many open source "auth in a box" projects that you can self-host, such as Ory (https://github.com/ory/), Zitadel, Keycloak, and many other small projects.
They all have small differences but for small to mid scale projects its definitely manageable.