(response: Response, name: string)
| 12 | |
| 13 | /** First `Set-Cookie` header for `name`, as the raw header string. */ |
| 14 | const setCookieFor = (response: Response, name: string): string => { |
| 15 | for (const header of response.headers.getSetCookie()) { |
| 16 | if (header.startsWith(`${name}=`)) return header; |
| 17 | } |
| 18 | return ""; |
| 19 | }; |
| 20 | |
| 21 | // state = base64url(JSON { nonce, returnTo? }) — the app's login-state |
| 22 | // envelope (apps/cloud/src/auth/login-state.ts). |