login page refactor

This commit is contained in:
Alex Holliday committed 2026-02-06 21:11:46 +00:00
1 parent ea68e660fc
commit 514570da78
3 files changed
+35 -18

No files matched your search

+8 -1
View File
@@ -196,6 +196,13 @@ const authSlice = createSlice({
state.success = true;
state.msg = "Logged out successfully";
},
setAuthState: (state, action) => {
state.isLoading = false;
state.success = action.payload.success;
state.msg = action.payload.msg;
state.authToken = action.payload.data.token;
state.user = action.payload.data.user;
},
},
extraReducers: (builder) => {
// Register thunk
@@ -249,4 +256,4 @@ const authSlice = createSlice({
});
export default authSlice.reducer;
export const { clearAuthState } = authSlice.actions;
export const { clearAuthState, setAuthState } = authSlice.actions;