Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why a new admin account get redirected to /home instead of /admin/dashboard? #348

Closed
gabrielfigueroa opened this issue Dec 12, 2023 · 6 comments

Comments

@gabrielfigueroa
Copy link

Bug report

What I did:

I created a new admin user. Not the default admin account but a new user with the permission of Administrator.

What I expected to happen:

When I login I expect the exact same behavior as the admin account

What happened:

Instead of redirecting to /admin/dashboard it redirects to non-existing /home route

What I've already tried to fix it:

A lot of different things, from changing CONST HOME to trying to understand how the middleware RedirectIfAuthenticated.php works. Isn't this something that should work out of the box?

Backpack, Laravel, PHP, DB version:

PHP VERSION:

PHP 8.2.12 (cli) (built: Nov 11 2023 18:25:36) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.12, Copyright (c) Zend Technologies
with Zend OPcache v8.2.12, Copyright (c), by Zend Technologies

LARAVEL VERSION:

10.35.0.0

BACKPACK PACKAGE VERSIONS:

backpack/activity-log: 2.0.1
backpack/basset: 1.2.2
backpack/crud: 6.4.2
backpack/filemanager: 3.0.6
backpack/generators: v4.0.2
backpack/logmanager: v5.0.1
backpack/pagemanager: 3.2.0
backpack/permissionmanager: 7.1.1
backpack/pro: 2.0.20
backpack/revise-operation: 2.0.0
backpack/settings: 3.1.0
backpack/theme-coreuiv4: 1.1.1
backpack/theme-tabler: 1.1.2

Copy link

welcome bot commented Dec 12, 2023

Hello there! Thanks for opening your first issue on this repo!

Just a heads-up: Here at Backpack we use Github Issues only for tracking bugs. Talk about new features is also acceptable. This helps a lot in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that.

Backpack communication mediums:

  • Bug Reports, Feature Requests - Github Issues (here);
  • Quick help (How do I do X) - Gitter Chatroom;
  • Long questions (I have done X and Y and it won't do Z wtf) - Stackoverflow, using the backpack-for-laravel tag;

Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome awesome community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch.

Thank you!

--
Justin Case
The Backpack Robot

@jcastroa87
Copy link
Member

Hello @gabrielfigueroa what do you set as a "guard" is config/backpack/base.php ?

And i will need the "guard" on the "Roles" table to compare. The new user and the old adming share the same "guard"?

Thanks.

@gabrielfigueroa
Copy link
Author

gabrielfigueroa commented Dec 12, 2023

Hello @gabrielfigueroa what do you set as a "guard" is config/backpack/base.php ?

And i will need the "guard" on the "Roles" table to compare. The new user and the old adming share the same "guard"?

Thanks.

'guard' => 'backpack'

All records under roles have backpack as value on the guard_name field.

I fixed the problem temporarily by setting the field is_admin to 1 on the users table for said user.

@jcastroa87
Copy link
Member

So can you check if you have something special set in the method "checkIfUserIsAdmin" vendor/backpack/crud/src/app/Http/Middleware/CheckIfAdmin.php or if you overwrite this method.

Thanks.

@jcastroa87
Copy link
Member

Hello @gabrielfigueroa did you have a chance to check about that method?

Thanks.

@jcastroa87
Copy link
Member

Hi @gabrielfigueroa

Due to no activity I will close this issue, but if you need to continue you can reopen it or if it is a new issue, you can create a new issue.

Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants