feat: clear logout state on signup page initialization.

This commit is contained in:
pradeepkumar
2026-03-17 11:01:46 +05:30
parent 7dfa93adb5
commit aac05dd12d

View File

@@ -4,6 +4,7 @@ import { useState, useEffect } from 'react';
import { signIn } from 'next-auth/react';
import Link from 'next/link';
import { authService, AuthService, RegisterRequest, agentsService, AgentType } from '@/services';
import { resetLogoutState } from '@/services/api';
type UserType = 'USER' | 'AGENT';
@@ -27,8 +28,11 @@ export default function SignUpPage() {
const [selectedAgentTypeId, setSelectedAgentTypeId] = useState('');
const [loadingAgentTypes, setLoadingAgentTypes] = useState(false);
// Fetch agent types on mount
// Clear logout flags and fetch agent types on mount
useEffect(() => {
localStorage.removeItem('isLoggingOut');
resetLogoutState();
const fetchAgentTypes = async () => {
setLoadingAgentTypes(true);
try {