Merge pull request #7255 from Nerdinacan/fix_logout_behavior_7249

Changed logout behavior to automatically redirect home
This commit is contained in:
Dannon
2019-01-24 10:22:39 -05:00
committed by GitHub
2 changed files with 16 additions and 8 deletions
+14 -3
View File
@@ -9,6 +9,18 @@ import { CommunicationServerView } from "layout/communication-server-view";
import Webhooks from "mvc/webhooks";
import Utils from "utils/utils";
function logoutClick() {
let galaxy = getGalaxyInstance();
let token = galaxy.session_csrf_token || "";
if (galaxy.user) {
galaxy.user.clearSessionStorage();
}
let url = `${galaxy.root}user/logout?session_csrf_token=${token}`;
window.top.location.href = url;
}
var Collection = Backbone.Collection.extend({
model: Backbone.Model.extend({
defaults: {
@@ -290,9 +302,8 @@ var Collection = Backbone.Collection.extend({
},
{
title: _l("Logout"),
url: `user/logout?session_csrf_token=${Galaxy.session_csrf_token}`,
target: "_top",
divider: true
divider: true,
onclick: logoutClick
},
{
title: _l("Saved Datasets"),
+2 -5
View File
@@ -38,11 +38,8 @@ def inherit(context):
<%def name="javascript_app()">
${ parent.javascript_app() }
<script type="text/javascript">
//HACK: should happen before we get to this page - _before_ logged out of session
config.addInitialization(function(galaxy, config) {
if (galaxy.user) {
galaxy.user.clearSessionStorage();
}
config.addInitialization(function(galaxy) {
window.location.href = galaxy.root;
});
</script>
</%def>