Add logout route and controller, remove JWT from user on logout

This commit is contained in:
Alex Holliday committed 2024-08-09 13:33:13 -07:00
1 parent 68164b9362
commit 9f4d23b1b4
4 files changed
+26 -1

No files matched your search

+2 -1
View File
@@ -99,9 +99,10 @@ function NavBar() {
// Clear auth state
dispatch(clearAuthState());
dispatch(clearUptimeMonitorState());
// Make request to BE to remove JWT from user
await axiosIntance.post(
"/auth/logout",
{},
{ user: authState.user },
{
headers: {
Authorization: `Bearer ${authState.authToken}`,