mirror of
https://github.com/umami-software/umami.git
synced 2026-02-12 08:37:13 +01:00
Moved env checks to server pages.
This commit is contained in:
parent
5b6292dd11
commit
784677e180
7 changed files with 18 additions and 18 deletions
|
|
@ -1,15 +1,14 @@
|
|||
'use client';
|
||||
import { useEffect } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { useApi, useConfig } from '@/components/hooks';
|
||||
import { useApi } from '@/components/hooks';
|
||||
import { setUser } from '@/store/app';
|
||||
import { removeClientAuthToken } from '@/lib/client';
|
||||
|
||||
export function LogoutPage() {
|
||||
const config = useConfig();
|
||||
const router = useRouter();
|
||||
const { post } = useApi();
|
||||
const disabled = !!(config?.loginDisabled || process.env.cloudMode);
|
||||
const disabled = process.env.cloudMode;
|
||||
|
||||
useEffect(() => {
|
||||
async function logout() {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,10 @@ import LogoutPage from './LogoutPage';
|
|||
import { Metadata } from 'next';
|
||||
|
||||
export default function () {
|
||||
if (process.env.DISABLE_LOGIN) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return <LogoutPage />;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue