illchuk / zfc-user-redirect-uri
ZfcUser redirection to specific URI, rather than to a generic route
v0.1
2017-11-01 21:42 UTC
Requires
- php: ^5.4|^7.0
- zf-commons/zfc-user: ^1.2 || ^2.0 || ^3.0
Requires (Dev)
- phpunit/phpunit: ~4.0
This package is auto-updated.
Last update: 2025-01-08 09:55:40 UTC
README
Install with composer require illchuk/zfc-user-redirect-uri
.
Then reference in modules.config.php
:
return [
..., 'ZfcUser', 'ZfcUserRedirectUri', ...
];
If you're using ZfcUser's /user/login?redirect=ROUTE
feature, you may now redirect to any routable URI instead: ROUTE
can become for example /ROUTABLE/URI/3?message=OK
.
This is especially useful when using ZfcRbac and user is hit with the login screen; they log in then carry on right where they left off.
ZfcRbac config as follows:
'redirect_strategy' => [
'redirect_when_connected' => true,
'append_previous_uri' => true,
'previous_uri_query_key' => 'redirect'
],
N.B. URI's that cannot be routed by your app are silently discarded.