revamp template
This commit is contained in:
10
src/auth/useAuthContext.ts
Normal file
10
src/auth/useAuthContext.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import { useContext } from 'react';
|
||||
import { AuthContext } from './providers/JWTProvider';
|
||||
|
||||
export const useAuthContext = () => {
|
||||
const context = useContext(AuthContext);
|
||||
|
||||
if (!context) throw new Error('useAuthContext must be used within AuthProvider');
|
||||
|
||||
return context;
|
||||
};
|
||||
Reference in New Issue
Block a user