-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
Description
Hi,
I have the following configuration:
A "Users" table with columns id, username and password (hash), tenant_id and role.
The following configuration of the api.php
'address' => 'db',
'username' => 'username',
'password' => 'xxxxxxxxxxxx',
'database' => 'database',
'middlewares' => 'sanitation,cors,dbAuth,multiTenancy,authorization',
'cors.allowHeaders' => ("Content-Type, X-XSRF-TOKEN, X-Authorization"),
'cors.allowCredentials' => 'true',
'dbAuth.registerUser' => '1',
'multiTenancy.handler' => function ($operation, $tableName) {
return ['tenant_id' => $_SESSION['user']['tenant_id']];
},
'authorization.tableHandler' => function ($operation, $tableName) {
return $tableName != 'users';
},
'sanitation.handler' => function ($operation, $tableName, $column, $value) {
return is_string($value) ? strip_tags($value) : $value;
},
'debug' => true
If I take out the dbAuth and Authorization, it works and I get the data returned (GET - records/...).
When calling the login route I get the error:
POST: https://url/services/api.php/login
{
"code": 9999,
"message": "Call to a member function getName() on null"
}
What could be the reason?
It runs in a docker container.
Greetings
Jayken