SHADE is young: 0.1.0-next.2 is a pre-release, and 0.1.0 isn't out yet.

SHADE
People, security and privacy

Accounts and personal pages

Accounts let people sign in on the client's website, for example customers or members. A visitor who signs in has an account. They sign up, confirm their email address and sign in on the site's /account page. Parts of a page can then differ per account (a part per visitor), while the rest of the site stays static files. Accounts are off until an admin switches them on.

Accounts are not team members. The team (the people who use the admin) is a separate system with their own sign-in; they get their own page. An account can never reach the admin.

What accounts can do

Admins:

  • On the Accounts screen: switch accounts on or off (email must be set up first), see and search all accounts.
  • Help an account: send the confirmation email again, send them a link to choose a password, correct their name, or sign them out on every device. Admins can't confirm an address by hand: that would confirm whatever password the account has, whoever chose it. The link to choose a password confirms the address once the account uses it.
  • Delete an account, for example when someone asks for their data to be erased.
  • Give an account a role of a module, and take it away: the hosts of a location, a booking manager (see Account roles).

Editors:

  • Add the Account starter component to any page, or build a Part per visitor of their own (see On the website).
  • Build the site's account pages from the starters Sign in, Create account, New password and My account (the Components screen's starter components, with the website module), styled and translated like any page. Each links to the others' pages through a property (The account page, The page to create an account, The page to choose a new password, Where signing out goes).

Accounts, on the site's account pages:

  • Create an account with name, email and password; they get an email with a link to confirm the address.
  • Confirm the address: the link opens the page they signed up on, which asks for the password they chose; that confirms the address and signs them in. Opening the link alone confirms nothing.
  • Sign in after confirming.
  • Ask for a password reset link by email and choose a new password. This confirms the address if it wasn't yet, and signs them out on every device, the one they reset on included; they sign in again with the new password.
  • Signing up with an address that already has an account sends that address a link to choose a password (the sign-up itself answers as for a new address).
  • See who they are signed in as, and sign out.
  • Delete their own account, confirmed with their password.
  • See a personal greeting on pages with one, or an invitation to sign in.
  • Use what modules offer accounts, on SHADE's site or on a frontend in another framework: their own appointments, to cancel (Appointments), and their own orders (Shop), found by their confirmed address, guest bookings and orders included. Only their own data, and only once their address is confirmed.
  • With a module's role, do that role's work on the site: hosts of a location see its bookings, a booking manager also makes others hosts there (only lower roles, only in their own location).

Who may do it

ActionPermissionRoles
See the settingsettings.readadmin
See the Accounts screen and the listprivate.read, never part of a custom roleadmin
Switch accounts on or offsettings.updateadmin
Help an account (the actions menu) and delete an accountsettings.updateadmin
Add and edit a part per visitor in a pagecollections.website-pages.updateadmin, editor, ai (drafts only)
Sign up, confirm the address, sign in, reset password, delete own accountnone (the account's own session)accounts, while accounts are on
Use what a module offers accountsnone of SHADE's: the module decides, by the accountaccounts with a confirmed address, while accounts are on
Give and take an account's rolesaccounts.roles, never part of a custom role, never a module'sadmin
Do a module role's work on the sitewhat the role allows; SHADE checks itaccounts with such a role
Give and take a lower role, in their own placea role that may give it; SHADE checks itaccounts with such a role

Editors, custom roles and AI accounts do not see the Accounts entry in the sidebar (it requires private.read).

In the admin

Accounts (sidebar entry "Accounts", NL "Gebruikers"):

  • A card Accounts with a short explanation and the switch Allow accounts.
    • When email is not set up, the switch cannot be turned on and the card says "Accounts confirm their address by email, so email has to be set up first." with a link Set up email to the Email screen.
    • Switching shows "Accounts are on" / "Accounts are off", or "Could not switch accounts" with the reason.
    • While accounts are on, a second switch Accounts may start organisations (off by default) lets any account with a confirmed address start an organisation on the site.
  • An account's actions menu has Organisations: the organisations it belongs to, with its Membership in each.
  • A search field ("Search name or email…") and a table with the columns Name, Email, Email confirmed (badge Confirmed or Not confirmed), Signed in ("Not signed in", "On 2 devices": sessions that have not expired) and Since (relative time). Pagination appears above 25 accounts. With none: "No accounts yet."
  • An actions menu per row ("Actions for {name}"), only for admins (settings.update). Each action is in the audit log without the account's name or address (accounts.update, accounts.confirmation, accounts.password-link, accounts.sign-out):
    • Send confirmation email again (unconfirmed accounts only; the email leads to the site's /account, where the account enters their password; refused once the address is confirmed);
    • Send a link to choose a password ("Link to choose a password sent"): the password reset email for the address, leading to the site's /account. Once the account chooses a password with it, the address is confirmed and every session of the account ends. This is how to help an account who can't confirm (someone else chose the account's password, or they forgot it); there is no confirming by hand;
    • Change name (a dialog; 1–120 characters);
    • Sign out everywhere (when signed in somewhere): ends every session;
    • Delete the account of {name}, which asks "Delete the account of {name}?" ("The account and its sessions are removed for good, for example when someone asks for their data to be erased.") with the button Delete account.
    • Roles, for admins (accounts.roles): see Account roles.

The screen is also in Dutch.

Account roles

Modules declare account roles for the people who work in a client's system on its site: the hosts of a location, their booking managers. An admin gives them on the account's screen: Accounts, the actions menu of an account, Roles.

  • The dialog Roles of {name} lists the account's roles, each by its module's title and the module's name for it (Appointments: Host; the id, appointments:host, on hover), with the place it is given for (the location's name), who gave it ("Given by Anna", "Given by account Mia") and when. "No roles." when there are none; a role of a module that is no longer installed is marked Module not installed (it gives nothing), and one the module has changed since (an update gave the role a place, another kind of place, or none) is marked The module changed this role: it gives nothing now: take it away and give the role again.
  • Give a role: choose one of the installed modules' roles. The dialog says what its members may do ("Members may: appointments.bookings.read, …"); for a role whose members may give roles themselves, it warns: "Members of this role may give others these roles themselves: …. Giving it raises a security alert." A role given per place asks For which locations (the module's places, by name). Give role gives it ("Role given").
  • Roles go only to accounts with a confirmed address ("Roles are given only to accounts with a confirmed email address."); an account who has the role already is refused.
  • The × button beside a role (Take away {role}) takes it away ("Role taken away"). It counts at once: the account's next request is refused, even though they are still signed in.
  • Every change is in the audit log as accounts.roles (who, which account, which role and place). Giving a role whose members give roles raises the security alert An account was given a role that gives roles (Errors).

On the website

The account pages are pages of the site, static like the rest, built from four starter components. Each is an interactive part that reads the visitor's account when the page opens, so nothing personal is ever built into the page. SHADE's site has them at /account (Sign in with My account beside it), /sign-up and /reset-password, in each visible language (/account, /en/account); they are hidden from search engines. Their words are Dutch on Dutch pages, otherwise English.

  • Sign in: for someone signed out, Sign in with email and password, then the account page; links to Forgot your password? and No account yet? Create one. Signed in, it shows nothing, so it can stand beside My account.
  • Create account: name, email and password (at least 10 characters), then "Almost done: we sent you an email"; opened from the confirmation email, Confirm your email address with the password chosen at sign-up, the button Confirm, and "Don't know the password, or did not create this account yourself? Choose a new password", which links to the new password page.
  • New password: Forgot your password? asks for the email and sends a link; opened from that link, New password and Save password.
  • My account: for someone signed in, their name and email, Sign out (then the page set as Where signing out goes), Download my data (a my-data.json with everything the site keeps about their address, see Personal data) and Delete account, asking for the password.
  • When accounts are off, the parts say "Accounts are not available on this site."
  • Messages for common cases: address not confirmed yet, wrong email or password, an account with that address already exists, password too short, too many attempts, an expired link (a reset or confirmation link that no longer works), a password that does not belong to the account being confirmed, and "Your email address is confirmed. You are signed in."
  • "Forgot your password?" always answers "If there is an account with this address, a link is in your inbox", so it does not reveal whether an address has an account.
  • A frontend in another framework that uses SHADE's renderer gets all of this too. A frontend with its own account pages must handle confirmation and reset links the same way: see the developers' page, Accounts: sign-in and modules' routes.

Parts per visitor:

  • A Part per visitor in a page is filled in for each visitor when the page loads; the rest of the page stays static. Its formulas can read whether the visitor is signed in and the account's name and email; nothing else. If SHADE can't be reached, it shows as for someone signed out.
  • The Account starter component is one: a greeting with the visitor's name and a link to /account, or an invitation to sign in. The old Account block went with the blocks.
  • What it shows is never cached, so one account never sees another's.
  • In the editor's preview and on the canvas a part per visitor shows as for a visitor who is not signed in.
  • Parts per visitor need the site's server part to run beside the static files; without it they stay empty (Setting up an instance (Coolify)).

Rules and limits

  • Off by default. While off, nobody can sign up or sign in. Switching off keeps the accounts.
  • Email is required. Switching on without email set up is refused ("Set up email first").
  • Confirmed email before sign-in. An unconfirmed account cannot sign in.
  • Confirming takes the link and the password. Anyone can sign up, also with another person's address and a password of their own. If opening the link were enough, a link scanner in the owner's inbox (Outlook Safe Links, a company's mail gateway) would confirm the address for the stranger, who can have the email sent again, and could then sign in and download everything the site keeps for that address with Download my data (form submissions, orders, bookings, also from before the account). So the address is confirmed only when the account's password is entered on the page the link opens. The owner doesn't know a stranger's password, and chooses a new one instead.
  • A reset confirms and ends every session. A password reset proves the account owns the address, so it confirms the address and signs out every session of the account: whoever signed up first with that address loses the account with their password.
  • Links stay private. The secret in a confirmation or reset link never ends up in the site's logs or analytics.
  • Passwords: 10 to 256 characters, stored only as a hash. When many are being checked at once, the team goes first and an account's sign-in can fail with "Too many passwords are being checked at once. Try again in a moment." A sign-in that fails on the server's side (a password that cannot be checked, the database down) is recorded in the error log, never answered as a wrong password.
  • Email addresses are unique and stored lowercase.
  • Sessions last 30 days and are extended once a day of use.
  • Separate from the team: an account's session never counts as a team member's session.
  • Only the site. Sign-in and what modules offer accounts work only for the site's own address (the Site URL setting): other websites' pages cannot use them with an account's sign-in.
  • Rate limits: each action (sign-in, sign-up, reset …) 10 times a minute per network address, reading the session 120 times, confirming an address 10 times a minute; then "too many attempts" (Request protection). Per account too, however many networks ask: 20 sign-ins a quarter hour, 3 sign-up and confirmation emails an hour together, and 3 reset links an hour of their own, so sign-ups never keep an account from choosing a password. Anyone can use up one account's sign-in budget for a quarter hour, or its reset budget for up to an hour (an accepted risk); the account then waits, or an admin sends them a link to choose a password from the Accounts screen, which these budgets don't limit.
  • No other ways to sign in. No magic links, one-time codes or social sign-in (see Signing in).
  • Emails (confirmation, password reset, and "there is an account with this address already") go out through SHADE's email, tagged account-accounts, in the language of the page the account came from (Dutch or English), with the site name in that language. A failed send is logged on the server and never shown to the account. The reset email says the link works for an hour; the confirmation email asks for the password chosen at sign-up and says that without the link and the password nobody uses an account with that address.
  • Deleting an account (by an admin or by the account) removes it with its sessions and sign-in records. It is audited as accounts.delete with only the account's id: the summary holds no name or address.
  • Reserved page addresses: account, preview, pagefind, _astro and _server-islands cannot be page slugs. The analytics module does not count /account.
  • Export and deletion per person go by email address on the admin's Personal data screen (account, form submissions, emails, and the modules' data); see Personal data. Accounts delete their own account on the site (Delete account); that needs a sign-in younger than an hour or the password, and is audited like an admin's delete, without the address.
  • What modules offer accounts:
    • only to an account signed in with a confirmed address, while accounts are on, and only from the site itself: another website cannot act with the account's sign-in, not even through a link;
    • 60 requests a minute per account, unless the module sets its own limit, and 300 a minute per network address before anyone is signed in;
    • an account only ever gets their own data; it is in Download my data and is deleted with the account, also on a request for erasure;
    • only trusted modules (server packages) can offer it. Installing one lists what it offers accounts and the accounts' data it keeps, and an update that adds any asks again.

    Commerce still takes orders from anonymous visitors; appointments has pages for the hosts of a location (below).
  • Account roles:
    • a module declares its roles: what members may do, the lower roles they include, whether a role is per place (a location, a team) and which roles members may give. Installing lists all of it; an update that adds a role or something a role may do asks again;
    • SHADE checks the role on every request, before the module acts, so a role taken away counts at once; an account sees only the places of their roles;
    • an account with a role that gives roles gives only lower roles of the same module, only in their own place, never their own roles;
    • roles are personal data: on the admin's Personal data screen and in Download my data, erased on request, and deleted with the account; uninstalling the module removes its roles (they are in its backup);
    • bounded on purpose: one place per role, no rules language, no separate customers in one install, no single sign-on.
  • The links in emails go to the site's account page (the Site URL setting). The site must be set up so that signing in happens on its own address; SHADE warns at start when it is not (Setting up an instance (Coolify)).

For developers

The code and its tests: shade/features/accounts/README.md in the shade repository.