php-crud-api
php-crud-api copied to clipboard
DbAuthMiddleware not working
my users table name: users
config: tables' => 'product,manufacturer,category',
blocking acces // Authorization 'authorization.tableHandler' => function ($operation, $tableName) { return $tableName != 'users'; },
and response
{"code":9999,"message":"SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name ''"}
i think it gives this error because realName is empty
i think it gives this error because realName is empty
I think you may need to have the table 'users' in the 'tables' property. Can you try that?
no it doesn't work again if i remove "authorization.tableHandler" function it works
same here, using "authorization.tableHandler" gives 500 internal server error

What is the order of your middlewares? Maybe move 'authorization' after the 'dbAuth'? Could that be it?
Do you have an update?
Closing due to inactivity.