mirror of
https://github.com/evroon/bracket.git
synced 2026-04-22 16:27:05 -04:00
Redirect when logged in for demo page (#1435)
Also fix wrong port options in process-compose config
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
import { Alert, Button, Checkbox, Container, Paper, Title } from '@mantine/core';
|
||||
import { useForm } from '@mantine/form';
|
||||
import { IconAlertCircle } from '@tabler/icons-react';
|
||||
import React, { useState } from 'react';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useNavigate } from 'react-router';
|
||||
|
||||
import { ClientOnly } from '../components/utils/react';
|
||||
import { HCaptchaInput } from '../components/utils/util';
|
||||
import { tokenPresent } from '../services/local_storage';
|
||||
import { registerDemoUser } from '../services/user';
|
||||
import classes from './create_account.module.css';
|
||||
|
||||
@@ -14,6 +15,11 @@ export default function CreateDemoAccountPage() {
|
||||
const navigate = useNavigate();
|
||||
const { t } = useTranslation();
|
||||
const [captchaToken, setCaptchaToken] = useState<string | null>(null);
|
||||
useEffect(() => {
|
||||
if (tokenPresent()) {
|
||||
navigate('/');
|
||||
}
|
||||
}, []);
|
||||
|
||||
async function registerAndRedirect() {
|
||||
const response = await registerDemoUser(captchaToken);
|
||||
|
||||
@@ -4,7 +4,7 @@ log_level: debug
|
||||
processes:
|
||||
frontend:
|
||||
working_dir: "frontend"
|
||||
command: "pnpm run dev"
|
||||
command: "pnpm run dev --port 3000"
|
||||
availability:
|
||||
restart: "on_failure"
|
||||
readiness_probe:
|
||||
@@ -36,7 +36,7 @@ processes:
|
||||
|
||||
docs:
|
||||
working_dir: "docs"
|
||||
command: "pnpm run dev -p 3001"
|
||||
command: "pnpm run dev --port 3001"
|
||||
availability:
|
||||
restart: "on_failure"
|
||||
readiness_probe:
|
||||
|
||||
Reference in New Issue
Block a user