Revoke the sessions for a batch of users

Hi, I'd like to find a way to revoke all existing sessions for a batch of users. I have a list of userIds, and I'd like to revoke all corresponding sessions.

I see that the admin plugin has a revokeAllUserSessions but this means I would have to iterate through the list and revoke them one by one.

Also, the admin plugin, even called on the server, requires the headers and cookie in order to know who calls the method. But I'd like my backend to have this feature that's accessible even to some specific users who don't have the "admin" role on the admin plugin

Is there a way to expose a method to revoke user sessions ?

I'd like to access auth.context.internalAdapter.deleteSessions but from my own code, is there anything like that that's possible?
Was this page helpful?