Javascript Api: Assignment Manager Logout Error

Confluence User - 31 Jan, 2022

I'm trying to implement logout function which let the user logout and then redirect him to another page I specify. I'm using the UniversalTheme. Currently I have added a function to logout the user using AssignmentManager logout as per joget documentation. The issue that I'm facing currently that It's first throwing an error in my console saying that connection refused the other thing I'm not this will allow me to add some code for redirection after logout. My question is as follows:

  1. What is the best way to logout the user and redirect him to some page I specify?
  2. Why AssignmentManager connection refused?
  3. Does AssignmentManager redirect user after logout?

Logout code:

html = html + "    <li><a onclick=\"user_logout()\">
<i class=
\"fa fa-power-off\"></i> "
+ ResourceBundleUtil.getMessage("theme.universal.logout") + "</a></li>\n</ul>";

Javascript Api Code:

function user_logout(){

window.location.href=AssignmentManager.logout('http://localhost/jw');
}


universaltheme;javascript;java

1


07 Feb, 2022
confluenceUser
confluenceUser

Hi, regarding the connection refused it is likely that your server URL is incorrect. However to logout you can just call the logout URL that you see when you are logged in, which is /jw/j_spring_security_logout. If you wish to redirect after that, you would likely need to call the logout URL in the background like https://stackoverflow.com/questions/56355126/call-url-in-background.

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print