bolt / core

🧿 Bolt 5 core
https://boltcms.io
MIT License
541 stars 159 forks source link

Problem when deleting Bolt user and creating a new one #2827

Open eduardomart opened 3 years ago

eduardomart commented 3 years ago

Bolt v4.1

I forgot the password to my user, so I went to the cli and the only options are: add, delete, list, so I deleted the user, and created a new one. However once I try to login with the new user, I see this:

Screen Shot 2021-09-11 at 4 54 58 PM

Similar issue in 5.0 cli for 5.0 does have a reset-password option, however if you actually delete the username with ID=1 and create a new one, the same message in the screenshot above will appear as well

I think that Bolt wants a user to have an ID of 1, which can only be changed by editing the database. After editing the ID of the username to 1 does cause Bolt to log in normally.

abdellahrk commented 2 years ago

@bobdenotter can I work on this? I have in mind that if a user is being created from the CLI, we can check to see if there's any user with the id 1 and if not we set the current user's id to 1 and then persist. Or recursively shift the ids of existing users so that their ids should start from 1 and so on. Please advise.