Additional before_close_account for admin panel #216
Replies: 1 comment 1 reply
-
|
If your admin users are authenticated through the Rodauth actually has a neat solution for performing authentication actions on behalf of other accounts – the internal_request feature. With this feature enabled, in your controller you could call the RodauthApp.rodauth.close_account(account_login: "[email protected]")Internally this makes a fake Rack request to the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! Janko Marohnić
Could you please advise me on the best way to do this, I have the basic functionality for the
after_close_accounthookand everything works fine, but I have a need that the admin on the admin panel can delete other accounts, the admin is a simple user who just has the flag admin, the functionality of rodauth I did not use for this, but decided to create a separate config for the removal of the account
that I could use
rodauth(:admin).close_account_path(email: email)to delete other people's accounts.But when I try to run the query it tries to redirect me to the login page
I think it's a problem with session key or something like that, is it possible to implement such functionality without drastic changes?
I can of course just directly call account closure in a self-designed controller, but I would like to use ready-made hooks, because in the future this config for admin will be expanded with the growth of the application.
Beta Was this translation helpful? Give feedback.
All reactions