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

[Bug] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'my_db.password_resets' doesn't exist (Connection: mysql, SQL: select * from password_resets where email = myemail limit 1) #4979

Closed
TheClaud99 opened this issue Mar 15, 2023 · 7 comments
Assignees
Labels

Comments

@TheClaud99
Copy link

TheClaud99 commented Mar 15, 2023

Bug report

What I did

I tried to use the forgot password on the admin panel login and i got this error becouse the password_resets table doesn't exists anymore on laravel 10

What I expected to happen

Send reset password email

What happened

Got this error

image

What I've already tried to fix it

I think the bug is in BackpackServiceProvider.php in this line with wrong table name. 'password_resets' shuold be changed in 'password_reset_tokens'

```
        app()->config['auth.passwords'] = app()->config['auth.passwords'] +
        [
            'backpack' => [
                'provider'  => 'backpack',
                'table'     => 'password_resets',
                'expire'    => config('backpack.base.password_recovery_token_expiration', 60),
                'throttle'  => config('backpack.base.password_recovery_throttle_notifications'),
            ],
        ];

```

Is it a bug in the latest version of Backpack?

Yes

Backpack, Laravel, PHP, DB version

When I run php artisan backpack:version the output is:

```
### PHP VERSION:
PHP 8.1.10 (cli) (built: Aug 30 2022 18:05:49) (ZTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.1.10, Copyright (c) Zend Technologies

### LARAVEL VERSION:
v10.3.3@90f24d9e2860ecf6b5492e966956270ceb98c03d

### BACKPACK PACKAGE VERSIONS:
backpack/crud: 5.5.2
backpack/generators: 3.3.16

```
@welcome
Copy link

welcome bot commented Mar 15, 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 channels:

  • 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;
  • Showing off something you've made, asking for opinion on Backpack/Laravel matters - Reddit;

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

@promatik promatik added Bug and removed triage labels Mar 16, 2023
@promatik promatik moved this to In Progress in This week Mar 16, 2023
@promatik promatik self-assigned this Mar 16, 2023
@promatik
Copy link
Contributor

Hi @TheClaud99, I can confirm this is an issue in new Laravel 10 installations 👌

I'm working on a fix for this one 🙌

@promatik
Copy link
Contributor

@TheClaud99 thank you for your report, we have a fix now 🎉

I've just opened a new PR to fix this issue; #4986

We may move the conversation about this issue to the PR thread, if you test it please let us know if it fixes your issue 🙌

@github-project-automation github-project-automation bot moved this from In Progress to Done in This week Mar 16, 2023
@cubilog
Copy link

cubilog commented May 23, 2023

This bug has been "closed" in March, since then, you've published seven new Backpack 5.x versions, yet the password reset feature on Laravel 10 is still unsupported.
The related pull request merge was blocked and still waiting for a fix and merge.

This bug was marked as DONE on the project board too. Please move it back to the IN PROGRESS state.
https://github.com/orgs/Laravel-Backpack/projects/13/views/13?filterQuery=%234979

(Update: I've checked and I see that the pull request itself is in the IN PROGRESS tab.)

@pxpm
Copy link
Contributor

pxpm commented May 23, 2023

This bug has been "closed" in March, since then, you've published seven new Backpack 5.x versions, yet the password reset feature on Laravel 10 is still unsupported. The related pull request merge was blocked and still waiting for a fix and merge.

This bug was marked as DONE on the project board too. Please move it back to the IN PROGRESS state. https://github.com/orgs/Laravel-Backpack/projects/13/views/13?filterQuery=%234979

(Update: I've checked and I see that the pull request itself is in the IN PROGRESS tab.)

Indeed @cubilog it's in progress and we are discussing a possible breaking change and or a documentation solution to fix the issue.

The current proposed solution is a workaround only. It introduces other possible problems and I am not totally comfortable with it.

I am on support this week, I am going to have another look at it.

Thanks for the heads up. 🙏

Cheers

@tabacitu tabacitu removed this from This week Jun 19, 2023
@hsh555
Copy link

hsh555 commented Sep 9, 2023

rename 'password_resets' to 'password_reset_tokens'

@pattihis
Copy link

pattihis commented Dec 6, 2023

rename 'password_resets' to 'password_reset_tokens'

Yes, in config/auth.php change it in the below section:

    /*
    |--------------------------------------------------------------------------
    | Resetting Passwords
    |--------------------------------------------------------------------------
    |
    | You may specify multiple password reset configurations if you have more
    | than one user table or model in the application and you want to have
    | separate password reset settings based on the specific user types.
    |
    | The expire time is the number of minutes that each reset token will be
    | considered valid. This security feature keeps tokens short-lived so
    | they have less time to be guessed. You may change this as needed.
    |
    */

    'passwords' => [
        'users' => [
            'provider' => 'users',
            'table' => 'password_reset_tokens',
            'expire' => 60,
            'throttle' => 60,
        ],
    ],

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

No branches or pull requests

6 participants