Skip to content

Commit

Permalink
feat: force sign ou
Browse files Browse the repository at this point in the history
  • Loading branch information
iaurg committed Dec 8, 2023
1 parent 3223d57 commit 220292b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion frontend/src/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@
import Link from "next/link";
import { UserInfo } from "../UserInfo";
import { Play, SignOut, Trophy } from "@phosphor-icons/react";
import { signOut } from "@/contexts/AuthContext";
import Cookies from "js-cookie";
import { api } from "@/services/apiClient";

export default function Header() {
const signOut = async () => {
Cookies.remove('accessToken');
Cookies.remove('refreshToken');
api.defaults.headers["Authorization"] = "";
window.location.href = "/login";
}

return (
<div className="flex justify-between items-center py-4 bg-black42-300 p-4 rounded-lg mb-2">
<div className="flex items-center ml-4">
Expand Down

0 comments on commit 220292b

Please sign in to comment.