Authentication
For Admin panel only projects, the login is /, the home page is /dashboard, and other panel pages omit the /admin prefix. The proxy matches /dashboard/:path*, /users/:path* and /settings/:path*. Components use @/components and @/components/ui. API endpoints such as /api/admin/users/export keep their paths. Examples below use the combined public website + admin panel layout; generated standalone guides use the app’s actual paths.
Dinvolt includes email/password sign-in, an admin panel, and password recovery with Better Auth. Use the built-in screens first, then customize the application-owned source as needed.
This guide applies to Public website + admin panel and Admin panel only projects.
Set up authentication
1. Complete the database setup
Run this from your generated project:
npx dinvolt setupbunx dinvolt setuppnpm dlx dinvolt setupyarn dlx dinvolt setupSetup completes the selected database environment and offers to create its first administrator. See database setup if the connection or tables are still pending.
2. Keep your local auth configuration
The generated .env.local already contains a random BETTER_AUTH_SECRET and your project’s Portless origin. Preserve the secret when adding credentials.
For a project named my-app, the local origin is:
BETTER_AUTH_URL=https://my-app.localhost
Start the development server with your package manager:
npm run devbun run devpnpm run devyarn run devSee local development for Portless setup. Restart the server after editing environment variables.
3. Open the admin panel
Open /admin on the local origin and sign in with the administrator created by setup.
| Route | Purpose |
|---|---|
/admin |
Sign in |
/admin/home |
Admin home |
/admin/users |
Search, create, and edit users |
/admin/forgot-password |
Request a password reset |
The login form appears immediately and remains usable while the client checks an existing session. Administrators continue to Home; signed-in users without the admin role see an access-denied message and can sign out.
In this section
- Administrators and users: Create the first administrator and manage user accounts.
- Sessions and authorization: Read sessions and protect server operations.
- Password recovery: Configure Resend and use the included reset flow.
- Auth configuration: Set deployment origins, change plugins and update the schema.