# |
Jul 23rd 2021, 13:00 |
paolo.bragagni |
*Pre-authorization check must return `Authorization\Policy\ResultInterface`, `bool` or `null`.* |
# |
Jul 23rd 2021, 12:56 |
kevin.pfeifer |
well i basically copied my values from the use statement but i forgot that you need to add the \ if youre not using the class via the use |
# |
Jul 23rd 2021, 12:54 |
paolo.bragagni |
before Authorization |
# |
Jul 23rd 2021, 12:52 |
kevin.pfeifer |
could be that i forgot the \ at the front of App ,:) |
# |
Jul 23rd 2021, 12:51 |
paolo.bragagni |
*Interface 'App\Middleware\UnauthorizedHandler\Authorization\Middleware\UnauthorizedHandler\HandlerInterface' not found* |
# |
Jul 23rd 2021, 12:49 |
kevin.pfeifer |
basically i forgot the extend of the already present RedirectHandler |
# |
Jul 23rd 2021, 12:49 |
kevin.pfeifer |
check again, should be more clear now |
# |
Jul 23rd 2021, 12:44 |
paolo.bragagni |
fighting with namespaces |
# |
Jul 23rd 2021, 12:39 |
kevin.pfeifer |
i mixed 2 things together, let me fix that |
# |
Jul 23rd 2021, 12:39 |
kevin.pfeifer |
ah sorry, i forgot something |
# |
Jul 23rd 2021, 12:37 |
paolo.bragagni |
wait |
# |
Jul 23rd 2021, 12:37 |
paolo.bragagni |
I'm stupid |
# |
Jul 23rd 2021, 12:37 |
paolo.bragagni |
:S |
# |
Jul 23rd 2021, 12:37 |
paolo.bragagni |
*Handler `Regtosc` does not exist.* |
# |
Jul 23rd 2021, 12:32 |
paolo.bragagni |
thank you Kevin. trying to reproduce |
# |
Jul 23rd 2021, 12:32 |
kevin.pfeifer |
you can check out https://github.com/LordSimal/authorization/blob/master/docs/en/middleware.rst#how-to-create-a-custom-unauthorizedhandler till we wait till my PR is being reviewed |
# |
Jul 23rd 2021, 12:31 |
kevin.pfeifer |
well since you will be implementing a custom handler you can do that logic in there too |
# |
Jul 23rd 2021, 12:11 |
paolo.bragagni |
also redirection to previuos page needs an handler? |
# |
Jul 23rd 2021, 12:10 |
paolo.bragagni |
hhihi thanks (I think that its a common request, so probably should be included someway in default code) |
# |
Jul 23rd 2021, 12:08 |
kevin.pfeifer |
I am just in the process of updating the doc since its a bit more “advanced” I would say |
# |
Jul 23rd 2021, 12:06 |
paolo.bragagni |
first of all I dont know how to create my own handler |
# |
Jul 23rd 2021, 12:05 |
paolo.bragagni |
not so easy |
# |
Jul 23rd 2021, 11:46 |
paolo.bragagni |
:) |
# |
Jul 23rd 2021, 11:46 |
paolo.bragagni |
arghhhh |
# |
Jul 23rd 2021, 10:54 |
kevin.pfeifer |
so basically the example uses the RedirectHandler (`Authorization.Redirect` in your array above) which is this class in the plugin https://github.com/cakephp/authorization/blob/master/src/Middleware/UnauthorizedHandler/RedirectHandler.php |
# |
Jul 23rd 2021, 10:53 |
kevin.pfeifer |
what you do in that handle() function is basically up to you |
# |
Jul 23rd 2021, 10:52 |
kevin.pfeifer |
and with that you can also (as the doc describes) create your own Handler https://github.com/cakephp/authorization/blob/15aa0e01746c797ed3ce5ce745a7a3f08ccc0c6e/docs/en/middleware.rst#handling-unauthorized-requests |
# |
Jul 23rd 2021, 10:51 |
kevin.pfeifer |
|
# |
Jul 23rd 2021, 10:50 |
kevin.pfeifer |
The Flash message topic is pretty re-occuring. let me search the slack for how to do that |
# |
Jul 23rd 2021, 10:37 |
paolo.bragagni |
and what about flash message that shows user that it hasnt the authorization? |
# |
Jul 23rd 2021, 10:37 |
paolo.bragagni |
something like 'url' => $this->referer() |
# |
Jul 23rd 2021, 10:36 |
paolo.bragagni |
'unauthorizedHandler' => [ 'className' => 'Authorization.Redirect', 'url' => '/users/login', 'queryParam' => 'redirectUrl', 'exceptions' => [ MissingIdentityException::class, OtherException::class, ], |
# |
Jul 23rd 2021, 10:36 |
paolo.bragagni |
Hi in unauthorizedHandler how to redirect to last page? |
# |
Jul 23rd 2021, 00:14 |
web-54 |
hello |
# |
Jul 22nd 2021, 17:47 |
zxcvxcvzxcv |
=# |
# |
Jul 22nd 2021, 15:00 |
tyler.adam.lazenby |
hahaha |
# |
Jul 22nd 2021, 15:00 |
tyler.adam.lazenby |
Thanks @dereuromark I will have to go back the white board and figure out my logic. again |
# |
Jul 22nd 2021, 13:23 |
paolo.bragagni |
I know I know but I need it. I'll do my own thanks. |
# |
Jul 22nd 2021, 13:02 |
ndm |
That aside, that plugin is so basic, just do your own. |
# |
Jul 22nd 2021, 13:00 |
ndm |
Using embedded SQL queries sounds like a terrible idea, IMHO that's a job for stored procedures and/or views. |
# |
Jul 22nd 2021, 12:53 |
paolo.bragagni |
something similar to this https://github.com/morrislaptop/reports for cake4? |