Passing values from middleware to database hooks?
I have a password history checker that I want to fail early in the "Before" middleware. I only have access to the user's email, so I use that to get the user's ID etc. I don't want to have to query again in the "Before Account Update" hook (which only gives me access to the hashed password via
but it doesn't remain on the body for the db hooks. What's the BA recommended way to pass values between middleware and db hooks?
account.password). I tried returning in the middleware hook as shown in BA example: but it doesn't remain on the body for the db hooks. What's the BA recommended way to pass values between middleware and db hooks?