In the web at least it was returning 500, I guess that the desktop/mobile apps make some check in intervals. When the backend returned 500 the app thought that the current login could not be authenticated and logged out everybody
I really like this approach, however I have a use case where the application user id that made the operation must be saved in the audit table, unfortunately, I cannot see how to do that with a pure SQL solution.
[1] https://youtube.com/playlist?list=PLowKtXNTBypFbtuVMUVXNR0z1...