Skip to content

Commit

Permalink
Merge pull request loco-rs#468 from ximon18/missing-api-url-base-in-a…
Browse files Browse the repository at this point in the history
…uth-feat-docs

Fix /api/auth URLs in authentication feature docs.
  • Loading branch information
kaplanelad authored Feb 29, 2024
2 parents ba353f2 + 71ea69d commit 88e8c98
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions docs-site/content/docs/features/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,25 @@ $ cargo loco routes
.
.
.
[POST] /auth/forgot
[POST] /auth/login
[POST] /auth/register
[POST] /auth/reset
[POST] /auth/verify
[GET] /user/current
[POST] /api/auth/forgot
[POST] /api/auth/login
[POST] /api/auth/register
[POST] /api/auth/reset
[POST] /api/auth/verify
[GET] /api/user/current
.
.
.
```

### Registering a New User

The `/auth/register` endpoint creates a new user in the database with an `email_verification_token` for account verification. A welcome email is sent to the user with a verification link.
The `/api/auth/register` endpoint creates a new user in the database with an `email_verification_token` for account verification. A welcome email is sent to the user with a verification link.

##### Example Curl Request:

```sh
curl --location '127.0.0.1:3000/auth/register' \
curl --location '127.0.0.1:3000/api/auth/register' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Loco user",
Expand All @@ -70,7 +70,7 @@ After registering a new user, use the following request to log in:
##### Example Curl Request:

```sh
curl --location '127.0.0.1:3000/auth/login' \
curl --location '127.0.0.1:3000/api/auth/login' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "[email protected]",
Expand Down Expand Up @@ -101,7 +101,7 @@ Upon user registration, an email with a verification link is sent. Visiting this
#### Example Curl request:

```sh
curl --location '127.0.0.1:3000/auth/verify' \
curl --location '127.0.0.1:3000/api/auth/verify' \
--header 'Content-Type: application/json' \
--data '{
"token": "TOKEN"
Expand All @@ -117,7 +117,7 @@ The `forgot` endpoint requires only the user's email in the payload. An email is
##### Example Curl request:

```sh
curl --location '127.0.0.1:3000/auth/forgot' \
curl --location '127.0.0.1:3000/api/auth/forgot' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "[email protected]"
Expand All @@ -131,7 +131,7 @@ To reset the password, send the token generated in the `forgot` endpoint along w
##### Example Curl request:

```sh
curl --location '127.0.0.1:3000/auth/reset' \
curl --location '127.0.0.1:3000/api/auth/reset' \
--header 'Content-Type: application/json' \
--data '{
"token": "TOKEN",
Expand Down

0 comments on commit 88e8c98

Please sign in to comment.