Skip to content

Commit

Permalink
fix(w3up-client): authorize agent to use space
Browse files Browse the repository at this point in the history
  • Loading branch information
fforbeck committed Dec 20, 2024
1 parent f00600b commit 20d4830
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/w3up-client/src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ export class Client extends Base {
*
* @typedef {object} SpaceCreateOptions
* @property {Account.Account} [account] - The account configured as the recovery account for the space.
* @property {import('@ipld/dag-ucan').DID<'web'>} [provider] - The provider to use for the space.
* @property {Array<ConnectionView>} [authorizeGatewayServices] - The DID Key or DID Web of the Gateway to authorize to serve content from the created space.
* @property {boolean} [skipGatewayAuthorization] - Whether to skip the Gateway authorization. It means that the content of the space will not be served by any Gateway.
*
Expand Down Expand Up @@ -332,6 +333,9 @@ export class Client extends Base {
]
}

// Save the space to authorize the client to use the space
await space.save()

for (const serviceConnection of authorizeGatewayServices) {
await authorizeContentServe(this, space, serviceConnection)
}
Expand Down

0 comments on commit 20d4830

Please sign in to comment.