| … | … | @@ -63,6 +63,10 @@ export function encodeInvite (opts = {}) { |
| 63 | 63 | name: opts.name || null, |
| 64 | 64 | key, |
| 65 | 65 | roles: opts.roles || ['reader'], |
| 66 | // `source` (optional): where to reach the owner for write-enrollment |
| 67 | // — e.g. the owning daemon's serverKey. Makes the invite |
| 68 | // self-contained so a joiner knows whom to ask to be enrolled. |
| 69 | source: opts.source || null, |
| 66 | 70 | seed: opts.seed ? hex(opts.seed) : null, |
| 67 | 71 | expiresAt: opts.expiresAt || null, |
| 68 | 72 | maxUses: opts.maxUses == null ? 1 : opts.maxUses, |
| … | … | @@ -91,6 +95,7 @@ export function decodeInvite (invite) { |
| 91 | 95 | name: payload.name || null, |
| 92 | 96 | bootstrapKey: payload.key, |
| 93 | 97 | roles: payload.roles || ['reader'], |
| 98 | source: payload.source || null, |
| 94 | 99 | seed: payload.seed || null, |
| 95 | 100 | expiresAt: payload.expiresAt || null, |
| 96 | 101 | maxUses: payload.maxUses == null ? 1 : payload.maxUses |