Estoy tratando de agregar autenticación a un sitio web de reacción usando firebase. Actualmente tengo este createasyncthunk
export const signin = createAsyncThunk< // Return type of the payload creator User | void, // First argument to the payload creator userData, // Types for ThunkAPI { rejectValue: errorInterface; } >('authentication/signin', (user, thunkApi) => { const { email, password } = user; signInWithEmailAndPassword(auth, email, password) .then((userCredential) => { // Signed in const user = userCredential.user; return user; }) .catch((error) => { console.log(error.message, error.code) const errorMessage: errorInterface = { message: error.code }; return thunkApi.rejectWithValue(errorMessage); }); });el tipo de usuario se importa de fire base los datos de usuario son la siguiente interfaz para representar las credenciales utilizadas para iniciar sesión
interface userData { email: string; password: string; }la interfaz de error es la siguiente
interface errorInterface { message: string; }el segmento de autenticación es este
export const authSlice = createSlice({ name: 'authentication', initialState, reducers: {}, extraReducers: (builder) => { builder .addCase(signin.pending, (state) => { state.status = 'loading'; state.isAuth = false; }) .addCase(signin.fulfilled, (state, action) => { state.status = 'idle'; state.isAuth = true; if (action.payload) { state.user = action.payload; } }) .addCase(signin.rejected, (state, action) => { state.status = 'failed'; state.isAuth = false; if (action.payload) { state.message = action.payload.message; } }) }, });El problema es que signin.rejected nunca se activa. Incluso cuando se ejecuta el bloque catch, el rechazo con valor no actualiza la carga útil. Sé que el bloque catch se está ejecutando porque puedo ver el error en la consola. Por favor ayúdenme, gracias de antemano