Auth / Auth and Guard
What the client sees
The browser runs no rule and holds no session. What it knows comes from the server, through Remote, and each package has its own piece:
| On the client | From | Meaning |
|---|---|---|
Me (Guards.me) | guard | one row: signedIn, key, and may for named interactions. Read like any row: Loading, Ready, forgotten by Remote.forget |
may on a row | guard | whether this principal may make a write, answered by the server |
RemoteData.denied(error) | Remote | Unauthenticated (auth's 401: sign in again) or Forbidden (guard's 403: not yours) |
believing() | auth | a fetch for Remote's transport that repeats whom the server last answered as, so a read after another tab switched account is refused rather than answered as the other account |
Site.access | site | presentation from Me: send a visitor to sign in instead of drawing an empty page. Never a security boundary |
The rule of thumb: draw from may, recover from denied. A button the
server says you may not press is not drawn; a 401 means sign in again
(Remote.forget after a change of principal), a 403 means the server
refused this one write.