Cannot change logout action in Welcome/Admin, works in Tasklist/Cockpit


I need to modify my springboot camunda webapp deployment so that it redirects browser to different web after logout. I managed to do so for Cockpit and Tasklist, but in the Welcome and Admin screens it’s not working for some reason.
I’ve added following customScript to all of these application:

define(['angular'], function(angular) {
console.log('SCRIPT INITED');
var ngModule = angular.module('ssoLogout', []);
ngModule.controller('camHeaderViewsCtrl', ['$window', '$scope', function($window, $scope) {
    console.log('SCRIPT LOADED');
    var isLoggedIn = true;
    var listener = $scope.$root.$on('authentication.changed', function(ev, auth) {
        console.log('Authentication changed');
        if(!auth && isLoggedIn) {
    // remove listener to 'authentication.changed' event
    $scope.$on('$destroy', function() {
return ngModule;


I know the script is loaded on each of these pages, because I get SCRIPT INITED in the console, but I get the next log SCRIPT LOADED only in Cockpit and Tasklit screens.

I don’t know a lot about angular so I don’t know how to debug this. Is the camHeaderViewsCtrl only in two of these application?
Maybe there’s some better way to add the custom scripts so I don’t have to modify each application separately.


After studying the sources, it seems there’s no camHeaderViewsCtrl in the Welcome and Admin pages. In Admin page, the controller is called “NavigationController” and in the Welcome page, the controller is “WelcomePage”. After modifying the scripts, my logout action works.


Hi @neplatnyudaj

Have you noticed that by using your implementation the navigation for Cockpit disappears? Using camHeaderViewsCtrl seems to remove the navigation header in Cockpit. Have you experienced this?



Hi. It seems we’re doing the same thing. I’ve created a separate script for each app and seems to be working.
And btw I have the same problem with logout redirect which you are solving in another thread. But for me it’s not a big deal since it won’t be used by end-user.


Hi @neplatnyudaj I’ve created separate scripts as well but on Cockpit it loses the navigation menu. Strange. Do you have an example of your config.js for cockpit?



Decided to use:$window, $rootScope)

instead of controller and this works.


Here’s how I’m doing it:

There’s a bit of a hack with setting the correct ssoUrl through authentications.


@neplatnyudaj Thanks for sharing your js files. Must be a version issue which means if I use the controller it replaces the navigation. The run approach works for me.

Thanks for your help.