You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes developers forget to run DbMigrator to create and seed the database. Or somehow they delete the database later and use EF Core's Update-Database command to create the database again. As the result, they have the database tables, but the tables are empty. So, they can not login to the application.
In that situation, we can help developers to understand what is going on. My suggestion:
If we enter admin as user name, and the user was not found in the database, and if we are in development environment, throw a user-friendly exception like "Could not find the admin user. Please ensure that the database seed is executed. See https://abp.io/kb/0003 for possible solutions."
also it may not be a good solution to search for admin. users can intentionally delete admin user. my suggestion is checking any user in the AbpIoUsers table
@ebicoglu I said that only development time. And if developer writes "admin", then they probably know what they do. OK, if we want that check the whole table record count, then we should do it if admin user tries to login and it was not found. I don't want it takes time on every application startup or every application request, or on every login operation. Performance is critical and we don't want to decrease performance for something very rarely happen.
Sometimes developers forget to run DbMigrator to create and seed the database. Or somehow they delete the database later and use EF Core's Update-Database command to create the database again. As the result, they have the database tables, but the tables are empty. So, they can not login to the application.
In that situation, we can help developers to understand what is going on. My suggestion:
If we enter
admin
as user name, and the user was not found in the database, and if we are in development environment, throw a user-friendly exception like "Could not find the admin user. Please ensure that the database seed is executed. See https://abp.io/kb/0003 for possible solutions."Please also complete that document: https://abp.io/docs/latest/kb/can-not-login-with-admin-user
I only added a list of topics that is covered in that document. You write all the possible reasons, their solutions, etc.
The text was updated successfully, but these errors were encountered: