Public
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to force-logout a user?

Hello!

I just banned a spammer but I notice that they still show up as "logged in." Can I force a logout?

(side note: seems odd that banning a user doesn't automatically log them out)

Thanks!

6 Replies 6

I've wondered about this as well.  

--
Community manager in the Micro Focus Community. My computer always used to beat me at chess, but it is no match for me now I changed the competition to kick boxing.

Someone smarter from an engineering side could correct me, but I think the easiest way to 'kick them out' would be to just add a script to the page initialization that if the user status = banned, kick them to a banned page or some such thing. It would at least take care of letting them "in" until their session expires.

Also +1 you would think they would do this automatically.

Boss

@CarolineS,

As @StanGromer mentioned, we did the same thing with one of our community. We check the user status on page init, and if user is banned we redirect them to a banned page and logged them out from the community at the same time.

.......
Expecting your Kudos and Accepted Solution to my replies.

Thanks, @Parshant, @StanGromer, and @Gonzalles! Checking on page init seems straightforward enough. I’ll look into doing that.

Boss

@CarolineS, Also in addition to my answer, add this context object

${webUi.getUserLogoutPageUrl("/")}

in place of redirect_url of setRedirectUrl context-object

http.response.setRedirectUrl("redirect_url")

Once the condition is matched, it will take user to logout page.

P.S: Do not add redirect variable directly without condition into page init, it will take you into a continuous loop, and can result to server down error into your community.

 

.......
Expecting your Kudos and Accepted Solution to my replies.

@Parshant - thank you so much! Super useful!

Welcome to the Technology board!

Curious about our platform? Looking to connect on social technology? You've come to the right place!

Are you a Khoros customer? For direct assistance from our Support team, please visit the Support Forum.