Auth
The authentication system is handled by the Better Auth library, which provides most features you will ever need, plus some more.
Better-auth is heavily plugin-based, we propose a few guides on how to add some specific features like organizations, admin, etc.
❓ How it works
Section titled “❓ How it works”Better-auth is using your database to store all of its data. Depending on the ORM you use, you might need to create some entities to store the data.
We use MikroORM in this boilerplate, and you can find the entities in the auth module.
📝 How to use
Section titled “📝 How to use”Better-auth provides server and client methods, see the Better Auth documentation for more details.
Better-auth provides a OpenAPI schema and a live documentation of your API endpoints. You can find it at http://localhost:3000/api/auth/reference by default.
🧹 How to remove
Section titled “🧹 How to remove”- Delete the
authmodule from theapi/src/modulesfolder - Remove the AuthModule from the
api/src/app.module.tsfile - Remove the
api/src/config/better-auth.config.tsfile - Remove the following dependencies from the
api/package.jsonfile:
"better-auth","better-auth-mikro-orm",- Remove the following dependecies from the frontend apps
"better-auth",- Remove the following env variables from the
api/.envfile:
BETTER_AUTH_SECRET=