Skip to content

Commit c75c486

Browse files
committed
Add admin token docs
1 parent 9adbdee commit c75c486

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

docs/admin-page-flow.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,25 @@ Use the admin page to turn Cornell listserv emails into reviewed Loop events.
99
- Check the Gmail status dot in the top bar.
1010
- Use `Sign out` when finished.
1111

12+
### Admin Token
13+
14+
The admin page uses one shared secret token.
15+
16+
- The backend reads it from the Convex env var `ADMIN_TOKEN`.
17+
- Every admin action sends the token to Convex for verification.
18+
- The browser stores the entered token in `sessionStorage`, so it lasts only for the current browser session.
19+
- The token is never put in the Gmail OAuth URL; the app creates a short-lived nonce instead.
20+
21+
Set or update the token in the Convex dashboard for the target deployment:
22+
23+
1. Open the Convex dashboard.
24+
2. Select the Loop project and deployment.
25+
3. Go to environment variables.
26+
4. Set `ADMIN_TOKEN` to a long random value.
27+
5. Share it only with trusted admins.
28+
29+
For local development, set the same env var in the local Convex environment before using `/admin`.
30+
1231
## Recommended Workflow
1332

1433
1. `Setup`: connect Gmail and find candidate sources.

0 commit comments

Comments
 (0)