diff --git a/src/components/CapAppBar.tsx b/src/components/CapAppBar.tsx index b64ff68..ffb9182 100644 --- a/src/components/CapAppBar.tsx +++ b/src/components/CapAppBar.tsx @@ -76,8 +76,8 @@ export function CapAppBar() { {userStore.account ? ( ) : ( - - + + )} diff --git a/src/pages/auth/authorize.tsx b/src/pages/auth/authorize.tsx index 50a2b3a..817f06d 100644 --- a/src/pages/auth/authorize.tsx +++ b/src/pages/auth/authorize.tsx @@ -2,13 +2,17 @@ import { sni } from '@/services/network' import { Container, Box, Typography, Alert, Collapse, Button, CircularProgress, Card, CardContent } from '@mui/material' import { useRouter } from 'next/router' import { useEffect, useState } from 'react' +import { checkAuthenticatedClient, redirectToLogin, SnAuthTicket } from '@/services/auth' import ErrorIcon from '@mui/icons-material/Error' import CloseIcon from '@mui/icons-material/Close' import CheckIcon from '@mui/icons-material/Check' -import { SnAuthTicket } from '@/services/auth' export default function AccountAuthorize() { + useEffect(() => { + if (!checkAuthenticatedClient()) redirectToLogin() + }, []) + const router = useRouter() const [thirdClient, setThirdClient] = useState(null)