×

Please give details of the problem

Skip to content

Logout

This document explains how to create your own logout button and how to re-direct the user to another URL following logout.

1 Overview

This document explains how to enhance the standard RunMyProcess logout behaviour in two ways:

  1. There is a RunMyProcess logout button that is used as standard for all applilcations. Some users may wish to create their own button in order to customise their application.

  2. When a user logs out of an applicaiton, it is possible to re-direct them to another URL

2 Creating a customized logout button

To create your own logout button you need to include the jquery library as a footer in your Web Interface.

Add a hidden js widget at the bottom of the page with the following script:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
function logout_and_reload() {
$.ajax({
type : "GET",
url : "https://live.runmyprocess.com/logout",
data : {},
cache : false,
async : false,
dataType : "text",
success : function (data) {
window.location.reload();
},
error : function () {
window.location.reload();
}
});
}

Then add a html widget and enter this code:

1
<button class="gwt-Button rmpButton" onclick="logout_and_reload();">logout</button>

This button will log you out and reload the page.

Note : if you're using Google OAuth2 authentication and you want to also logout from Google, use this function instead:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
function rmp_google_logout() {
$.ajax({
type : "GET",
url : "https://live.runmyprocess.com/logout",
cache : false,
 async : false,
dataType : "text",
success : function (result) {
window.location = "https://www.google.com/accounts/Logout";
},
error : function (result) {
window.location = "https://www.google.com/accounts/Logout";
}
});
}

3 Redirecting following logout

It is possible to recirect users to a specific URL after a logout. This is achieved by passing the internal parameter P_target which should be set to the required URL.

https://live.runmyprocess.com/logout?P_target=[url]