Add useAuthentication hook and enhance useRouter for improved navigation and session management
- Introduced `useAuthentication` hook to handle session state, PIN verification, and offline mode logic. - Updated `useRouter` to include type definitions for better navigation instance typing. - Refined authentication flow with error handling, user session initialization, and token validation.
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
import {useNavigate, useParams as useRouterParams, Link, useLocation} from 'react-router-dom';
|
||||
|
||||
function useRouter() {
|
||||
export type AppRouterInstance = {
|
||||
push: (path: string) => void;
|
||||
replace: (path: string) => void;
|
||||
back: () => void;
|
||||
};
|
||||
|
||||
function useRouter(): AppRouterInstance {
|
||||
const navigate = useNavigate();
|
||||
return {
|
||||
push: (path: string) => navigate(path),
|
||||
|
||||
Reference in New Issue
Block a user