Skip to content

Commit

Permalink
fix: authorize renamed to login (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos authored Nov 14, 2023
1 parent 3753c27 commit 5638a4d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/pages/docs/how-to/create-account.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ You first need to create and register a Space you'll upload to. A Space acts as
The easiest way to create and register a Space is by using the CLI

1. Install the CLI from npm using your command line: `npm install -g @web3-storage/w3cli`
2. Run `w3 authorize [alice@example.com](mailto:alice@example.com)` in the command line using your email address. This will send an email to your inbox with a link for validation.
2. Run `w3 login [alice@example.com](mailto:alice@example.com)` in the command line using your email address. This will send an email to your inbox with a link for validation.
3. Once you click on the validation link, you'll be taken to a webpage where you can enter your payment information and select a plan (like our Free tier).
4. Create a new Space for storing your data and register it:
w3 space create
Expand Down
10 changes: 5 additions & 5 deletions src/pages/docs/how-to/upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ In the previous section, you created a Space that has a unique DID. To use the c
If you followed the Create account and Space section, you will already have the CLI set up with a Space. However, you might be using the CLI on a new machine, in which case you can follow these instructions:

1. (If not yet installed) Install the CLI from npm using your command line: `npm install -g @web3-storage/w3cli`.
2. Run `w3 authorize [alice@example.com](mailto:alice@example.com)` in the command line using your email address. Click on the validation link sent to your email.
3. After successfully running `authorize`, your CLI Agent has been delegated access to all Spaces associated with your email address. You can see a list of these Spaces using `w3 space ls` and select the one you'd like to upload to using `w3 space use \<space_did\>`.
2. Run `w3 login [alice@example.com](mailto:alice@example.com)` in the command line using your email address. Click on the validation link sent to your email.
3. After successfully running `login`, your CLI Agent has been delegated access to all Spaces associated with your email address. You can see a list of these Spaces using `w3 space ls` and select the one you'd like to upload to using `w3 space use \<space_did\>`.

When the right Space is selected, you are ready to upload! You can do so by running `w3 up \<path\>`.

Expand Down Expand Up @@ -76,13 +76,13 @@ const client = await create()

By default, clients will create a new [Agent](https://web3-storage.github.io/w3protocol/classes/_web3_storage_access.Agent.html) and put it in a persistent local [Store](https://github.com/web3-storage/w3up/tree/main/packages/access-client) if it can't find an existing one to load (so the next time the client is initialized on the same device, it will use the same Agent).

Then you can authorize your Agent with your email address. Calling authorize will cause an email to be sent to the given address.
Then you can login your Agent with your email address. Calling login will cause an email to be sent to the given address.

```javascript
await client.authorize('zaphod@beeblebrox.galaxy')
await client.login('zaphod@beeblebrox.galaxy')
```

Once a user clicks the confirmation link in the email, the authorize method will resolve. Make sure to check for errors, as authorize will fail if the email is not confirmed within the expiration timeout. Authorization needs to happen only once per agent. This also claims all delegations available with your email address, so from there, you can select the Space you'd like to use.
Once a user clicks the confirmation link in the email, the login method will resolve. Make sure to check for errors, as login will fail if the email is not confirmed within the expiration timeout. Authorization needs to happen only once per agent. This also claims all delegations available with your email address, so from there, you can select the Space you'd like to use.

```javascript
await client.setCurrentSpace(space.did()) # select the relevant Space DID that is associated with your account
Expand Down
2 changes: 1 addition & 1 deletion src/pages/docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ npm install -g @web3-storage/w3cli

You need to create a web3.storage account associated with an email address and set it up so you can start uploading to a Space. The Space is created locally and associated with a private key, and is then registered with web3.storage and associated with your email address. But don't worry about keeping track of the Space's private key! web3.storage's email authorization system allows this private key to be treated as a throwaway key.

1. Run `w3 authorize [alice@example.com](mailto:alice@example.com)` in the command line using your email address. This will sent an email to your inbox with a link for validation.
1. Run `w3 login [alice@example.com](mailto:alice@example.com)` in the command line using your email address. This will sent an email to your inbox with a link for validation.
2. Once you click on the validation link, you'll be taken to a webpage where you can enter your payment information and select a plan (like our Free tier).
3. Create a new Space for storing your data and register it:

Expand Down

0 comments on commit 5638a4d

Please sign in to comment.