mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
fix issues.
This commit is contained in:
@@ -7,10 +7,10 @@ export default function({ isAuthenticated =false, ...rest }) {
|
||||
const to = {pathname: '/dashboard/homepage'};
|
||||
|
||||
return (
|
||||
<BodyClassName className={'authentication'}>
|
||||
<Route path="/auth">
|
||||
{ (isAuthenticated) ?
|
||||
(<Redirect to={to} />) : (
|
||||
<Route path="/auth">
|
||||
{ (isAuthenticated) ?
|
||||
(<Redirect to={to} />) : (
|
||||
<BodyClassName className={'authentication'}>
|
||||
<Switch>
|
||||
<div class="authentication-page">
|
||||
<Link
|
||||
@@ -30,9 +30,10 @@ export default function({ isAuthenticated =false, ...rest }) {
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</Switch>)
|
||||
}
|
||||
</Route>
|
||||
</BodyClassName>
|
||||
</Switch>
|
||||
</BodyClassName>
|
||||
)
|
||||
}
|
||||
</Route>
|
||||
);
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import BodyClassName from 'react-body-classname';
|
||||
import { Route, Redirect } from 'react-router-dom';
|
||||
|
||||
const propTypes = {
|
||||
@@ -13,19 +14,21 @@ function PrivateRoute({
|
||||
...rest
|
||||
}) {
|
||||
return (
|
||||
<Route
|
||||
{...rest}
|
||||
path="/dashboard"
|
||||
render={_props =>
|
||||
isAuthenticated ? (<Component {..._props} />) :
|
||||
(
|
||||
<Redirect
|
||||
to={{
|
||||
pathname: '/auth/login',
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
<BodyClassName className={''}>
|
||||
<Route
|
||||
{...rest}
|
||||
path="/dashboard"
|
||||
render={_props =>
|
||||
isAuthenticated ? (<Component {..._props} />) :
|
||||
(
|
||||
<Redirect
|
||||
to={{
|
||||
pathname: '/auth/login',
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</BodyClassName>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user