Settings -> Sign-in: check, move (everyone into Accounts with their password hashes and authenticator apps, count/hash check, then switch) and undo for 14 days. Sign-in through auth-client with a one-time handoff to Events' own token; staff roles stepped up to mfa; sign-out and back-channel logout; user.updated/export/deleted; admin 2FA reset, unlock and profile changes via Accounts; /login, /register, /forgot-password forward once moved; Events' own sign-in endpoints answer SIGN_IN_MOVED. User.accountId, AccountsSignIn. npm run test:accounts runs Events' code against the real Accounts app (11 tests); 5 new Jest tests. MIGRATING-TO-3.md, plan "Changes while building". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
60 lines
3.5 KiB
Markdown
60 lines
3.5 KiB
Markdown
# Moving to Cross Events 3.0
|
|
|
|
Cross Events 3.0 can sign people in with the **church's account** (Accounts), the one they'll use
|
|
for the church website and app too. It's a major version because it needs Accounts 1.1.0 or later
|
|
next to it. **Updating to 3.0 changes nothing for anyone**: people keep signing in with their Cross
|
|
Events password until an admin moves sign-in (step 4). The plan behind it is
|
|
[docs/EVENTS-3.0-PLAN.md](../../docs/EVENTS-3.0-PLAN.md).
|
|
|
|
## For whoever runs the server
|
|
|
|
1. **Accounts first.** The church needs Accounts 1.1.0 or later on the same server: in the Hub,
|
|
New install → Accounts for this church (an `add-product` job), or update its Accounts. The Hub
|
|
won't offer the Events 3.0 update before that (`requires accounts 1.1.0`), and `crosscode deploy`
|
|
refuses it too.
|
|
2. **Connect them.** In Cross Events, Site settings → Linked products → Accounts → **Connect**. This
|
|
also registers Events as a sign-in client of Accounts; nothing else is typed in.
|
|
3. **Update Events to 3.0** as usual (scheduled update from the Hub). There's one migration
|
|
(`User.accountId`, `AccountsSignIn`, six audit actions) and no new `.env` variable.
|
|
4. **Move sign-in** when the church is ready (below).
|
|
|
|
## For the church's admin: moving sign-in
|
|
|
|
Site settings → **Sign-in**:
|
|
|
|
1. **Check the move.** Nothing changes. It lists how many people move, who already has a church
|
|
account (they're linked to it and keep that account's password), anyone who can't move and why,
|
|
and the guests and deleted people who stay in Cross Events only.
|
|
2. Tick which Cross Events admins should also be **Accounts admins** (they can manage everyone's
|
|
sign-in). By default every admin is ticked.
|
|
3. **Move sign-in to Accounts** at a quiet time (not the evening before a big event's registration
|
|
closes). It takes about a minute. People already signed in stay signed in.
|
|
|
|
What people notice afterwards:
|
|
|
|
- "Sign in" opens the church's sign-in page (with the church's name and colours) and comes back to
|
|
the page they were on.
|
|
- **Same password, same authenticator app.** People with two-step sign-in get 10 new recovery codes
|
|
after their first sign-in (the old ones can't move); they should save them.
|
|
- Supervisors and admins still need two-step sign-in; Accounts asks them to set it up if they don't
|
|
have it.
|
|
- Password, two-step sign-in, news choices, "download my data" and deleting an account are on the
|
|
church account (Profile and Privacy link there).
|
|
|
|
**Undo** (same page) goes back to Cross Events' own sign-in for 14 days. People then sign in with
|
|
the password they had at the move; anything changed in Accounts since (a new password, two-step
|
|
sign-in set up) doesn't come back. After 14 days Cross Events removes the old passwords and Undo
|
|
goes away.
|
|
|
|
## For integrations
|
|
|
|
- `POST /api/v2/auth/login`, `…/login/code`, `…/signup`, `…/password/forgot`, `…/password/reset`,
|
|
`…/activate`, `/me/two-factor/*`, `/me/verify-password` and `/me/close` answer **`409`** with
|
|
`{ "error": { "code": "SIGN_IN_MOVED", "signInUrl": "/api/auth/signin" } }` once sign-in has moved.
|
|
A script that signed in with a password needs another way in (ask Cross Code).
|
|
- `GET /api/v2/auth/mode` says `local` or `accounts`.
|
|
- Tokens are the same as before (`Authorization: Bearer …`, 30 days, ended by signing out). A token
|
|
from a sign-in through Accounts also carries `asi` and `mfa`.
|
|
- `PATCH /api/v2/me` ignores `name`, `email` and `phone` (they're changed in Accounts) and refuses a
|
|
password.
|