You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry, the code suggestion won't work because session.signedInUser doesn't exist. How can canUserAccessEndpoint get access to the UserInfo for the logged-in user?
It can be useful when used together with the auth module, which has a callback for approving a log in. But you are right, perhaps this should be an automatic check.
I assume the UserInfo is not looked up for the logged-in user on every API call, only the auth key is checked in the session.
So in order to be able to immediately revoke a user's rights using blocked (rather than only on login), not only should blocked be looked up for the user on login, but there probably needs to be methods Users.blockById and Users.blockByEmail that look up a user, set the UserId.blocked to true, then invalidate the auth key for the user.
How should that last step be performed, i.e. invalidating the session of a logged-in user who has active connections to the server?
Activity
lukehutch commentedon Mar 16, 2023
Sorry, the code suggestion won't work because
session.signedInUserdoesn't exist. How cancanUserAccessEndpointget access to theUserInfofor the logged-in user?vlidholt commentedon Mar 20, 2023
It can be useful when used together with the auth module, which has a callback for approving a log in. But you are right, perhaps this should be an automatic check.
lukehutch commentedon Mar 20, 2023
I assume the
UserInfois not looked up for the logged-in user on every API call, only the auth key is checked in the session.So in order to be able to immediately revoke a user's rights using
blocked(rather than only on login), not only shouldblockedbe looked up for the user on login, but there probably needs to be methodsUsers.blockByIdandUsers.blockByEmailthat look up a user, set theUserId.blockedto true, then invalidate the auth key for the user.How should that last step be performed, i.e. invalidating the session of a logged-in user who has active connections to the server?
lukehutch commentedon Jun 2, 2023
See the PR linked above this comment.