Logout

Plugin to add custom logout handlers. When the user explicitly logs out, or session expiration.

If the handler returns false all other logout handlers are skipped and the default logout process is cancelled.

Tutorial

Web Plugin

Register the plugin resource in a web plugin.

app.registerJavaScript("/org/visallo/examples/logout/plugin.js", true);

Register Extension

Register the logout extension that warns the user, prevents the default logout action, and does the logout itself.

visallo.registry.registerExtension('org.visallo.logout', function() {
    var seconds = 3;
    alert('Will logout in ' + seconds + ' seconds');
    _.delay(function() {
        visallo.connect()
            .then(function(connected) {
                $(document).trigger('willLogout');
                return connected.dataRequest('user', 'logout');
            })
            .then(function() {
                window.location.reload();
            })
    }, seconds * 1000)
    return false;
});

results matching ""

    No results matching ""