1 Answer
- Newest
- Most votes
- Most comments
0
The password_check hook is designed to validate passwords, not to modify user attributes like the valid_until timestamp. When you attempt to alter the role within the hook function, you're trying to modify the database during a process that's not intended for such modifications, leading to the "attempted to update invisible tuple" error.
It's however successful if you manually invoke it outside the context of the password change.
You can consider below options:
- Create a separate function/trigger that runs after a successful password change to update the valid_until timestamp.
- Implement a custom authentication method using the client authentication hook (clientauth) that runs after the authentication process, please refer here below:
Relevant content
asked 8 months ago
asked 2 years ago
