This commit is contained in:
grimhilt committed 2023-08-05 21:15:04 +02:00
1 parent d1f737afdd
commit 9e9a4b3897
2 files changed
+5

No files matched your search

+2
View File
@@ -1,4 +1,5 @@
import { createContext, useState, useContext } from 'react';
import API from '../services/api';
const AuthContext = createContext();
@@ -11,6 +12,7 @@ const AuthProvider = ({ children }) => {
const logout = () => {
localStorage.removeItem('user');
window.location.href = '/auth';
API.logout();
};
const useAuth = () => useContext(AuthContext);