fix
This commit is contained in:
parent
d94c1c3089
commit
14805dbfc4
@ -1,11 +1,11 @@
|
||||
import { useEffect } from 'react';
|
||||
import { AppRoutes } from './app/Routes';
|
||||
import './App.css';
|
||||
import { isTestMode } from './conf/config';
|
||||
import { Config } from './conf/config';
|
||||
|
||||
const BaseTag = () => {
|
||||
useEffect(() => {
|
||||
if (isTestMode) {
|
||||
if (Config.DEBUG) {
|
||||
const baseTag = document.createElement('base');
|
||||
baseTag.href = process.env.REACT_APP_BASE_URL || window.location.origin;
|
||||
document.head.prepend(baseTag);
|
||||
|
||||
@ -20,4 +20,3 @@ export class Config {
|
||||
static APP_NAME: string = environment.REACT_APP_APP_NAME ?? '';
|
||||
}
|
||||
|
||||
export const isTestMode = environment.REACT_APP_BASE_PATH !== environment.REACT_APP_ROOT_PATH;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { useAuth } from '../app/context/AuthProvider';
|
||||
import { isTestMode } from '../conf/config';
|
||||
import { Config } from '../conf/config';
|
||||
|
||||
export default function LoginPage() {
|
||||
const [username, setUsername] = useState('admin');
|
||||
@ -11,11 +11,11 @@ export default function LoginPage() {
|
||||
const navigate = useNavigate();
|
||||
|
||||
useEffect(() => {
|
||||
if (isTestMode && isAuthenticated) {
|
||||
if (Config.DEBUG && isAuthenticated) {
|
||||
navigate('/', { replace: true });
|
||||
return;
|
||||
}
|
||||
}, [isTestMode, isAuthenticated, navigate]);
|
||||
}, [isAuthenticated, navigate]);
|
||||
|
||||
const onSubmit = async (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user