[Bug] If checkIfUserIsAdmin method returns false, always redirect to /home URL
See original GitHub issueBug report
What I did
update checkIfUserIsAdmin
method to actually check whether the currently logged in user should be able to access backpack dashboard.
What I expected to happen
if the $user
is not matched the criteria, redirected to homepage or backpack login page
What happened
keeps redirect to /home
URL, even though that URL is not set in route.
What I’ve already tried to fix it
Updating the respondToUnauthorizedRequest
inside the same CheckIfAdmin
middleware.
However apparently all backpack-prefixed URL will always redirect to /home
URL if checkIfUserIsAdmin
method returns false and if there is actually a logged in user.
How can I change this /home
redirection URL ?
Backpack, Laravel, PHP, DB version
When I run php artisan backpack:version
the output is:
PHP VERSION:
PHP 7.4.5 (cli) (built: Apr 14 2020 16:17:34) ( ZTS Visual C++ 2017 x64 ) Copyright © The PHP Group Zend Engine v3.4.0, Copyright © Zend Technologies
LARAVEL VERSION:
v8.8.0@0bdd5c6f12cb7cb6644e484169656245af417735
LARAVEL VERSION:
v7.16.1@dc9cd8338d222dec2d9962553639e08c4585fa5b
BACKPACK VERSION:
4.1.25@23fb1ed5153d5465d49d2fe1ca265a5985c78877
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (10 by maintainers)
Top GitHub Comments
@iMokhles you’re right, I’ve made PRs to both of those changes.
@tabacitu this issue is from Laravel 7+ not only for Laravel 8+ as you mention in the doc