@user-hub/auth 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@user-hub/auth",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Sign people in from User Hub badges: Convex auth config, React provider, server verification and the hub-user CLI.",
5
5
  "type": "module",
6
6
  "files": [
@@ -7,9 +7,13 @@ description: Sign people into an app from their User Hub badge. Use when an app
7
7
 
8
8
  People at a workshop scan a printed QR badge. The hub sends them to whichever app is live, signed in, with a token in the URL fragment (`#token=…`) that only that app accepts. This package turns that token into a signed-in person. The app keeps its own data, keyed on the person's hub id.
9
9
 
10
- ## The hub
10
+ ## The hub's URL
11
11
 
12
- Ask the human for the hub's URL. It is `HUB_URL` for `hub-user`, the `HUB_ISSUER` the app trusts and the `VITE_HUB_URL` its frontend uses.
12
+ The hub has one address, for example `https://hub.example.com`. The human gives it to you; you need it in three places, all with the same value:
13
+
14
+ - `HUB_URL` in the app's `.env` or `.env.local`: read by `hub-user register` (**Register the app**). The human puts it there with the admin password.
15
+ - `HUB_ISSUER` on the app's Convex deployment: `hub-user register` prints it for you (**Set the two values**).
16
+ - `VITE_HUB_URL` in the app's frontend env: lets the dev server send you to the hub to sign in (**Wire it up**).
13
17
 
14
18
  ## Before you start: ask the human
15
19
 
@@ -31,10 +35,10 @@ You need four things. Ask for them; never guess.
31
35
  bun add @user-hub/auth
32
36
  ```
33
37
 
34
- 2. **Register the app** from the app's repo root, with the secrets supplied as the human chose in step 3 above:
38
+ 2. **Register the app** from the app's repo root, with `HUB_URL` and the password supplied the way the human chose in question 3 above:
35
39
 
36
40
  ```sh
37
- bunx hub-user register --name "Voting" --prod https://app.example.com --dev http://localhost:3000
41
+ bunx hub-user register --name "<app name>" --prod https://app.example.com --dev http://localhost:3000
38
42
  ```
39
43
 
40
44
  Leave out `--prod` if the app is not deployed yet. Running it again with the same `--name` updates the URLs; a URL left out keeps the registered one. If it fails with "set HUB_URL", "set HUB_ADMIN_PASSWORD" or a wrong password, stop and ask the human; do not work around it.
@@ -45,7 +49,7 @@ You need four things. Ask for them; never guess.
45
49
  - Convex: `bunx convex env set HUB_ISSUER '…'` and `bunx convex env set HUB_JWKS '…'` (on every deployment the app uses).
46
50
  - Other servers: their environment, same names.
47
51
 
48
- 4. **Wire it up** with the key from step 2.
52
+ 4. **Wire it up** with the key from **Register the app**.
49
53
 
50
54
  Convex, `convex/auth.config.ts`:
51
55