mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
14 lines
381 B
TypeScript
14 lines
381 B
TypeScript
import React from 'react';
|
|
import { Navigate } from 'react-router-dom';
|
|
|
|
import { ServerSelectors, useAppSelector } from '@app/store';
|
|
import { App } from '@app/types';
|
|
|
|
const AuthGuard = () => {
|
|
const isConnected = useAppSelector(ServerSelectors.getIsConnected);
|
|
return !isConnected
|
|
? <Navigate to={App.RouteEnum.LOGIN} />
|
|
: <div></div>;
|
|
};
|
|
|
|
export default AuthGuard;
|