diff --git a/packages/libs/web-common/src/App/UserMenu/UserMenu.jsx b/packages/libs/web-common/src/App/UserMenu/UserMenu.jsx index d04e25e929..5b68912c72 100644 --- a/packages/libs/web-common/src/App/UserMenu/UserMenu.jsx +++ b/packages/libs/web-common/src/App/UserMenu/UserMenu.jsx @@ -4,6 +4,7 @@ import { Link } from 'react-router-dom'; import './UserMenu.scss'; import { IconAlt as Icon } from '@veupathdb/wdk-client/lib/Components'; +import { showLogoutWarning } from '@veupathdb/wdk-client/lib/Actions/UserSessionActions'; class UserMenu extends React.Component { constructor(props) { @@ -12,13 +13,15 @@ class UserMenu extends React.Component { } renderMenu() { - const { user } = this.props; + const { user, actions } = this.props; const items = user.isGuest ? [ { icon: 'sign-in', text: 'Login', - route: '/user/login', + route: `/user/login?destination=${encodeURIComponent( + window.location + )}`, }, { icon: 'user-plus', @@ -36,16 +39,25 @@ class UserMenu extends React.Component { { icon: 'power-off', text: 'Log Out', - route: '/user/logout', + onClick: () => actions.showLogoutWarning(), }, ]; return (