It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to logout current user?


I try to add a button to logout in my plugin.

Which function can I use to logout the current user ?


Best regards,

1 answer

1 accepted

Thanks for your answer.

For the parameters of the method, I would like to return to the login page.

Can I juste past null for the two parameters?

No, you can not set nulls. You must call this function either in a servlet or something like this. When exactly do you want to have a user logged out?

Ok That's what I thought.

I made a modal which appears when the user is connected to the portal for the first time.

He had to accept, or he had to logout.

I had the button, the js function to call the rest API of my plugin and I have to logout my current user and redirect the user to the login page.


I hope that I'm clear.

Just an information, I use the Ultimate theming plugin to add js to portals

Oh, I see. I am not familiar with this plugin. You should ask the developers of the plugin on how you can use the Java Api. Or if it is JS, just make the same request, which is created, when you use the logout button in Jira. Open the Developer Tools in your browser and have a look at what request is made, when you logout. And repeat this request in your JS.

You're right. i will try this. Thanks again

 I use the rest API using the url : '/rest/auth/1/session', directly from my js file.


Thank for all.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira Service Desk

Tell us how you've implemented Change Management

Hello Community 👋, I'm a product manager at Atlassian, looking at improving change management capabilities across our products. In particular, we're looking at bridging the gap between Dev & ...

1,887 views 10 17
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you