Using shield, How i can redirect to separate url if the user not in admin group |
See may be help you https://github.com/codeigniter4/shield/d...nt-5768371
@sknair143 We made changes to cover this feature in the PR below.
Please review this if you can. https://github.com/codeigniter4/shield/pull/790 (08-17-2023, 06:46 AM)datamweb Wrote: @sknair143 We made changes to cover this feature in the PR below. Thanks !, But could you please help me to implement this on my project. Can you give me the steps to do please.
If I understand well, here is my solution to handle admin and portal namespaces.
Here is before method from my Admin filter: PHP Code: public function before(RequestInterface $request, $arguments = null) And here is before method from my Portal filter: PHP Code: public function before(RequestInterface $request, $arguments = null) As you can see I'm using group customer for my portal users. Here is updated redirects, loginRedirect and registerRedirect methods in Shield auth config. PHP Code: public array $redirects = [ PHP Code: public function loginRedirect(): string PHP Code: public function registerRedirect(): string
@sknair143 This feature was added to the Shield. Use the develop branch.
|
Welcome Guest, Not a member yet? Register Sign In |