mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-24 18:26:20 +01:00
Fix user logic.
This commit is contained in:
parent
02a1438cfe
commit
89f2fd601e
@ -3,7 +3,7 @@ export default () => null;
|
||||
export async function getServerSideProps() {
|
||||
return {
|
||||
redirect: {
|
||||
destination: '/buttons/websites',
|
||||
destination: '/settings/websites',
|
||||
permanent: true,
|
||||
},
|
||||
};
|
||||
|
@ -1,17 +1,11 @@
|
||||
import AppLayout from 'components/layout/AppLayout';
|
||||
import TeamSettings from 'components/pages/settings/teams/TeamSettings';
|
||||
import useUser from 'hooks/useUser';
|
||||
import { useRouter } from 'next/router';
|
||||
|
||||
export default function TeamDetailPage() {
|
||||
const { user } = useUser();
|
||||
const router = useRouter();
|
||||
const { id } = router.query;
|
||||
|
||||
if (!user) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<AppLayout>
|
||||
<TeamSettings teamId={id} />
|
||||
|
@ -1,14 +1,7 @@
|
||||
import AppLayout from 'components/layout/AppLayout';
|
||||
import TeamsList from 'components/pages/settings/teams/TeamsList';
|
||||
import useUser from 'hooks/useUser';
|
||||
|
||||
export default function TeamsPage() {
|
||||
const { user } = useUser();
|
||||
|
||||
if (!user) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<AppLayout>
|
||||
<TeamsList />
|
||||
|
@ -1,17 +1,11 @@
|
||||
import AppLayout from 'components/layout/AppLayout';
|
||||
import UserSettings from 'components/pages/settings/users/UserSettings';
|
||||
import useUser from 'hooks/useUser';
|
||||
import { useRouter } from 'next/router';
|
||||
|
||||
export default function TeamDetailPage() {
|
||||
const { user } = useUser();
|
||||
const router = useRouter();
|
||||
const { id } = router.query;
|
||||
|
||||
if (!user) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<AppLayout>
|
||||
<UserSettings userId={id} />
|
||||
|
@ -1,14 +1,12 @@
|
||||
import AppLayout from 'components/layout/AppLayout';
|
||||
import useConfig from 'hooks/useConfig';
|
||||
import useUser from 'hooks/useUser';
|
||||
|
||||
import UsersList from 'components/pages/settings/users/UsersList';
|
||||
|
||||
export default function UsersPage() {
|
||||
const { user } = useUser();
|
||||
const { adminDisabled } = useConfig();
|
||||
|
||||
if (adminDisabled || !user) {
|
||||
if (adminDisabled) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user