Skip to content
Dinvolt
Esc
↑↓navigate↵open⌘Jpreview
On this page

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 setup
bunx dinvolt setup
pnpm dlx dinvolt setup
yarn dlx dinvolt setup

Setup 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 dev
bun run dev
pnpm run dev
yarn run dev

See 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

Was this page helpful?