session sign out

main
alex 2023-05-18 14:41:39 +02:00
parent 8b2e631e3e
commit 71f0abf37b
1 changed files with 9 additions and 8 deletions

View File

@ -1,12 +1,6 @@
import { Badge, Button, Space, Table } from "antd";
import { Badge, Space, Table } from "antd";
import { useContext } from "react";
import {
Constants,
FormatDatetime,
UseUserSession,
WebSocketContext,
} from "../../utils";
import { unstable_HistoryRouter } from "react-router-dom";
import { Constants, FormatDatetime, WebSocketContext } from "../../utils";
const columns = [
{
@ -37,9 +31,16 @@ const columns = [
return (
<Space size="middle">
<a
href="#"
onClick={() => {
fetch(`${Constants.API_ADDRESS}/user/session/${record.key}`, {
method: "DELETE",
headers: {
"Content-Type": "application/json",
"X-Authorization": JSON.parse(
localStorage.getItem("session")
),
},
}).catch((err) => {
console.error(err);
});