login()
Log in an existing user.
- Javascript
- Go
- PHP
- API
const { user, token, error } = await kontenbase.auth.login({
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.Login(client.LoginParams{
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->login([
'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/login
note
token
returned is a Bearer Token Authentication that can be set in the header