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