fix registration on production

This commit is contained in:
aurinex
2025-12-19 21:45:24 +05:00
parent fef89513c2
commit 3aa99e7262

View File

@ -29,6 +29,7 @@ import {
isNotificationsEnabled, isNotificationsEnabled,
getNotifPositionFromSettings, getNotifPositionFromSettings,
} from '../utils/notifications'; } from '../utils/notifications';
import { useNavigate } from 'react-router-dom';
const ColorlibConnector = styled(StepConnector)(({ theme }) => ({ const ColorlibConnector = styled(StepConnector)(({ theme }) => ({
[`&.${stepConnectorClasses.alternativeLabel}`]: { [`&.${stepConnectorClasses.alternativeLabel}`]: {
@ -168,6 +169,8 @@ export const Registration = () => {
horizontal: 'center', horizontal: 'center',
}); });
const navigate = useNavigate();
const showNotification = ( const showNotification = (
message: React.ReactNode, message: React.ReactNode,
severity: 'success' | 'info' | 'warning' | 'error' = 'info', severity: 'success' | 'info' | 'warning' | 'error' = 'info',
@ -290,7 +293,7 @@ export const Registration = () => {
const handleVerifyCode = async () => { const handleVerifyCode = async () => {
const response = await getVerificationStatus(username); const response = await getVerificationStatus(username);
if (response.is_verified) { if (response.is_verified) {
window.location.href = '/login'; navigate('/login', { replace: true });
} }
}; };