mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-01-28 17:49:08 +03:00
api refactoring
This commit is contained in:
@@ -2,8 +2,7 @@ import { useContext } from 'react';
|
||||
import type { FC } from 'react';
|
||||
import { Navigate } from 'react-router-dom';
|
||||
|
||||
import * as AuthenticationApi from 'api/authentication';
|
||||
|
||||
import { fetchLoginRedirect } from 'components/routing/authentication';
|
||||
import { AuthenticationContext } from 'contexts/authentication';
|
||||
import type { RequiredChildrenProps } from 'utils';
|
||||
|
||||
@@ -11,7 +10,7 @@ const RequireUnauthenticated: FC<RequiredChildrenProps> = ({ children }) => {
|
||||
const authenticationContext = useContext(AuthenticationContext);
|
||||
|
||||
return authenticationContext.me ? (
|
||||
<Navigate to={AuthenticationApi.fetchLoginRedirect()} />
|
||||
<Navigate to={fetchLoginRedirect()} />
|
||||
) : (
|
||||
<>{children}</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user