register()
Register a new user.
- Javascript
- Go
- PHP
- API
const { user, token, error } = await kontenbase.auth.register({
firstName: 'Ega',
lastName: 'Radiegtya',
email: '[email protected]',
password: 'password',
})
Response
| Name | Type | Description |
|---|---|---|
| res.user | object | Response for data user |
| res.token | string | Response for data token |
| res.status | number | Response for status code |
| res.statusText | string | Response for status message |
| res.error | object | Response for error occurred |
info
Using this method in browser will also save the returned token in localStorage.
resp, err := client.Auth.Register(client.RegisterParams{
FirstName: "Ega",
LastName: "Radiegtya",
Email: "[email protected]",
Password: "password",
})
Response
| Name | Type | Description |
|---|---|---|
| resp.User | map[string]interface{} | Response for data user |
| resp.Token | string | Response for data token |
| resp.Status | int | Response for status code |
| resp.StatusText | string | Response for status message |
$res = $kontenbase->auth->register([
'firstName' => 'Ega',
'lastName' => 'Radiegtya',
'email' => '[email protected]',
'password' => 'password'
]);
Response
| Name | Type | Description |
|---|---|---|
| $res['user'] | object | Response for data user |
| $res['token'] | string | Response for data token |
| $res['status'] | integer | Response for status code |
| $res['statusText'] | string | Response for status message |
| $res['error'] | object | Response for error occurred |
[POST]
https://api.kontenbase.com/query/api/v1/API_KEY/auth/register
note
- First registered user will have "admin" role
tokenreturned is a Bearer Token Authentication that can be set in the header