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
@williamdclt The problem
There are a few reports about the failure of logging into admin panel after creating the admin user.
Reasons
There are two AdminUserService instances, both listening to the beforeInsert event. So when the password of an admin account being created is set, hashed, and saved to the database, the saving operation will immediately be captured by the other instance, which performs a hash to the hashed password, resulting in the final password hash stored in the database being double-hashed, and consequently the failure of login to the admin panel.
Evidence
This can be verified by console.log from the constructor of the AdminUserService class. I could see the contents got logged twice.
Solution/ PR
Unfortunately the problem is beyond my understanding. I am confused about why two service instances are being used, as can be seen in adminUser.module.ts that it's been provided/ injected in multiple places - normally a service should be singleton.
The text was updated successfully, but these errors were encountered:
@williamdclt
The problem
There are a few reports about the failure of logging into admin panel after creating the admin user.
Reasons
There are two
AdminUserService
instances, both listening to thebeforeInsert
event. So when the password of an admin account being created is set, hashed, and saved to the database, the saving operation will immediately be captured by the other instance, which performs a hash to the hashed password, resulting in the final password hash stored in the database being double-hashed, and consequently the failure of login to the admin panel.Evidence
This can be verified by
console.log
from the constructor of theAdminUserService
class. I could see the contents got logged twice.Solution/ PR
Unfortunately the problem is beyond my understanding. I am confused about why two service instances are being used, as can be seen in
adminUser.module.ts
that it's been provided/ injected in multiple places - normally a service should be singleton.The text was updated successfully, but these errors were encountered: