Skip to content
Unreleased: these pages follow the main branch. The latest release is v0.5.

2. Accounts

Issues have authors, so the app needs accounts. One command writes them.

Add accounts

go tool anetos make:auth
go run . migrate

make:auth writes the code of accounts into your project, as files you own and can change:

FileHolds
app/models/user.goUser, and models.Users, which tells package auth how to find and update users
app/handlers/auth.go, app/handlers/settings.goRegistration, login (with a password, Google or GitHub), email verification, password reset, two-factor authentication, API tokens, the settings page
views/auth.templ, views/settings.templTheir pages, and AccountMenu, the header’s links to log in, register and log out, which make:auth adds to views/layout.templ
routes/auth.goTheir routes. Pages for logged-in users go in its loggedIn group
auth_test.goTheir tests
database/factories/users.gofactories.Users, which makes users for your own tests

migrate creates the users, api_tokens and social_accounts tables.

Try it

Open http://localhost:8080/register and sign up. The app sends a link to verify your address: in development, emails go to the log (MAIL_DRIVER=log), so look in the terminal where anetos dev runs and open the link. You land on /dashboard (AUTH_HOME_URL sets another page; part 3 shows how); /settings changes your name, password, language and time zone.

go test ./... now runs the accounts’ tests too.

The accounts guide explains what’s there and how to change it.

Next: 3. Issues.