ch4mpy db46099bce BAEL-7380 : ul (CONFIGURATION)
OAuth2 BFF with spring-addons
2024-02-10 03:21:58 -10:00

24 lines
441 B
TypeScript

import axios from "axios";
export default function Logout() {
async function onClick() {
const response = await axios.post(
"/bff/logout",
{},
{
headers: {
"X-POST-LOGOUT-SUCCESS-URI": process.env.NEXT_PUBLIC_BASE_URI,
},
}
);
window.location.href = response.headers["location"];
}
return (
<button type="submit" onClick={onClick}>
Logout
</button>
);
}