-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
37 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,34 @@ | ||
# Initialization | ||
|
||
## Register admin user | ||
In this guide, most of the operations should be done on the swagger API page. | ||
If you do not change port settings, it should be on <http://localhost:9000/brickapi/v1/docs>. | ||
|
||
## Register user | ||
|
||
=== "Username / Password" | ||
|
||
1. Use the API `POST /brickapi/v1/auth/register` to register user. | ||
|
||
`email`, `password` and `name` can be set in the request body. | ||
|
||
```json | ||
{ | ||
"email": "[email protected]", | ||
"password": "string", | ||
"name": "string" | ||
} | ||
``` | ||
|
||
2. Use the API `POST /brickapi/v1/auth/cookie/login` to login the registered user with cookie. | ||
|
||
The `username` is same as the `email` set in the last step. | ||
|
||
|
||
=== "Google OAuth2" | ||
|
||
Before using this, ensure that [Google OAuth2](config/auth.md) has been setup in the configuration. | ||
|
||
Use the API `/brickapi/v1/auth/cookie/google/authorize` and it will return a json response in the format | ||
Use the API `GET /brickapi/v1/auth/cookie/google/authorize` and it will return a json response in the format | ||
|
||
```json | ||
{ | ||
|
@@ -22,9 +40,24 @@ | |
The page will be redirected back to the [FRONTEND_URL](config/backend.md#frontend_url) entry in configuration. | ||
By default, it is the url of the Swagger API if not set in configuration. | ||
|
||
!!! info | ||
|
||
Use the API `GET /brickapi/v1/users/me` to check user is successfully registered and logined. | ||
|
||
|
||
!!! note | ||
|
||
The admin user can also be registered in the frontend. | ||
User can also be registered in the frontend. | ||
However, it is recommanded to use the Swagger API for convenience of debugging the setup. | ||
|
||
## Set superuser | ||
|
||
Use the API `POST /brickapi/v1/users/init_superuser` to set the current user as superuser. | ||
This API can only be called when no superuser exist in the system. | ||
|
||
|
||
## Create domain | ||
|
||
1. Use the API `POST /brickapi/v1/domains/{domain}` to create a new domain. | ||
`domain` should be set to the name of the domain. | ||
2. |