kaffy icon indicating copy to clipboard operation
kaffy copied to clipboard

Logout button

Open Qizot opened this issue 4 years ago • 1 comments

How can I add logout button to the dashboard?

Qizot avatar Nov 18 '20 16:11 Qizot

Ok so this is definitely sort of a hack, but in case some other poor soul ends up here trying to figure something out.

Assuming that you have an endpoint like /auth/logout which can terminate a session, you can take advantage of Kaffy's Extensions functionality which allows a person to drop some javascript in, such as:

    <script>
          let navbarDiv = document.querySelector(".navbar-menu-wrapper");
          let logoutLink = document.createElement("a");
          logoutLink.text="Logout";
          logoutLink.href="/auth/logout";
          logoutLink.style="position: absolute; top: 10px; right: 10px;";
          navbarDiv.appendChild(logoutLink);
    </script>

ericmooney-at-angel avatar Nov 03 '21 19:11 ericmooney-at-angel