Skip to content

Commit

Permalink
updated readme for verify-token and refresh-token
Browse files Browse the repository at this point in the history
  • Loading branch information
Pooria Toof authored and Pooria Toof committed Aug 23, 2024
1 parent 0019584 commit 5a88255
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions Backend/token_service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,24 @@ The API runs on port 8000 and exposed to 8001.
## Tutorial to use the token_service

There are three endpoints in the token_service. The endpoints are:
- `auth/token/refresh/` - This endpoint is used to refresh the access token.
- `auth/token/refresh/` - This endpoint is used to refresh the access token. to refresh the access token you need to send a request to this endpoint with the refresh token in the request body. The request will be like this:
```json
{
"id": "user_id",
"refresh": "your refresh token"
}
```

- `auth/token/gen-tokens/` - This endpoint is used to generate the refresh and access tokens.
- `auth/token/invalidate-tokens/` - This endpoint is used by user-service logout or delete user to invalidate the refresh and access tokens.
- `auth/token/validate-token/` - This endpoint is used to validate the access token.

- `auth/token/validate-token/` - This endpoint is used to validate the access token. If you send a request from frontend to this API your request will be like this:
```json
{
"id": "user_id",
"access": "your access token",
"is_frontend": true
}
```
## The UserTokens model

The UserTokens model is used to store the refresh and access tokens. The UserTokens model has the following fields:
Expand Down

0 comments on commit 5a88255

Please sign in to comment.