Untitled

mail@pastecode.io avatar
unknown
javascript
a year ago
269 B
1
Indexable
Never
const PrivateRoute = ({ children }: PropsWithChildren) => {
    const accessToken = window.localStorage.getItem('Access token');
    
    if (!accessToken) {
        return <EvNavigate to={RoutePath.AuthLogin} replace state={location} />;
    }

    return children;
};