Fix Log out button not logging out

This commit is contained in:
Hornwitser committed 2022-06-23 16:57:52 +02:00
1 parent 826d89c7dc
commit 51c025c79b
2 files changed
+4 -4

No files matched your search

@@ -30,14 +30,14 @@ export default function SiteLayout(props) {
onClick={({ key }) => { onClick={({ key }) => {
if (key === "user") { if (key === "user") {
history.push(`/users/${account.name}/view`); history.push(`/users/${account.name}/view`);
} else if (key === "logout") { } else if (key === "logOut") {
account.logout(); account.logOut();
} }
}} }}
items={[ items={[
{ label: account.name, key: "user" }, { label: account.name, key: "user" },
{ type: "divider" }, { type: "divider" },
{ label: "Log out", danger: true, key: "logout" }, { label: "Log out", danger: true, key: "logOut" },
]} ]}
/>; />;
+1 -1
View File
@@ -9,7 +9,7 @@ import ControlContext from "../components/ControlContext";
* @property {?Array<object>} roles - Roles of the corrently logged in account. * @property {?Array<object>} roles - Roles of the corrently logged in account.
* @property {function(string)} hasPermission - * @property {function(string)} hasPermission -
* Check if the currently logged in account has the given permission. * Check if the currently logged in account has the given permission.
* @property {function()} logout - Logs out of the web interface. * @property {function()} logOut - Logs out of the web interface.
*/ */
export function useAccount() { export function useAccount() {