×

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

Include the jquery library as a resource in your Web Interface to create your logout button.

Add a hidden JS widget at the bottom of the page or a custom JS file with the following script:

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:

<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:

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]