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
if (Hash.needsReHash(user.password)) {
// You will have to tweak the model hook to not
// rehash the already hashed password
user.password = await Hash.make(plainPassword)
}
Does the hint with model hook adaption make any sense for you?
Why not just write
if (//needsReHash) {
user.password = plainPassword
}
Then the hook can do it's job and the hash is re-generated after the newest standards with the new work factor...
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi community,
I have just a quick question based on needsReHash documentation found at
https://docs.adonisjs.com/guides/security/hashing#needsrehash
In the sample code section it says
Does the hint with model hook adaption make any sense for you?
Why not just write
Then the hook can do it's job and the hash is re-generated after the newest standards with the new work factor...
Or am I wrong and mis-understand something?
Kind regards
Robin
Beta Was this translation helpful? Give feedback.
All reactions