feat: sign in sign up with all views
This commit is contained in:
11
kittyurl-frontend/src/hooks/useAuth.ts
Normal file
11
kittyurl-frontend/src/hooks/useAuth.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
// src/hooks/useAuth.ts
|
||||
import { useContext } from 'react';
|
||||
import { AuthContext } from '../context/AuthContext';
|
||||
|
||||
export const useAuth = () => {
|
||||
const context = useContext(AuthContext);
|
||||
if (!context) {
|
||||
throw new Error('useAuth must be used within an AuthProvider');
|
||||
}
|
||||
return context;
|
||||
};
|
||||
Reference in New Issue
Block a user