| … | … | @@ -230,6 +230,7 @@ export class HyperOrgs { |
| 230 | 230 | kind: 'org', |
| 231 | 231 | name, |
| 232 | 232 | roles: [opts.role || 'reader'], |
| 233 | source: opts.source || null, |
| 233 | 234 | expiresAt: opts.expiresAt || null, |
| 234 | 235 | maxUses: opts.maxUses == null ? 1 : opts.maxUses |
| 235 | 236 | }) |
| … | … | @@ -251,7 +252,9 @@ export class HyperOrgs { |
| 251 | 252 | if (decoded.kind !== 'org') throw new Error(`invite is for "${decoded.kind}", not an org`) |
| 252 | 253 | if (isExpired(decoded)) throw new Error('invite expired') |
| 253 | 254 | if (!decoded.name) throw new Error('org invite missing name (cannot key the org)') |
| 254 | | return this.mountOrg(decoded.name, decoded.bootstrapKey, decoded.roles[0] || 'reader') |
| 255 | const res = await this.mountOrg(decoded.name, decoded.bootstrapKey, decoded.roles[0] || 'reader') |
| 256 | // `source` (owner serverKey) lets the caller request write-enrollment. |
| 257 | return { ...res, source: decoded.source || null } |
| 255 | 258 | } |
| 256 | 259 | |
| 257 | 260 | /** |