Files
CPLv4.0/redux/slices/authSlice.ts
ISA 20e20dec30 feat(redux): Rename all Redux slices and store keys to match file names for clarity
- Renamed all slice names (createSlice `name` attribute) to match their file names (e.g. loopChartSlice, authSlice, kueDataSlice etc.)
- Updated `store.ts` to register each reducer with consistent key names (e.g. state.loopChartSlice instead of state.loopChart)
- Adjusted all `useSelector` and Redux state accesses across the codebase
- Improves maintainability, searchability and consistency across files and Redux DevTools
2025-04-01 12:26:41 +02:00

30 lines
764 B
TypeScript

// redux/slices/authSlice.ts
import { createSlice } from "@reduxjs/toolkit";
const authSlice = createSlice({
name: "authSlice",
initialState: {
isAdminLoggedIn: false,
users: {
Admin: {
username: "admin",
password:
"$2a$10$WO/pzNjkkbC4X3aCEcwd2ugMHQ8Wzq0unCYNePTAL01ZrS/rEAcGu", // Gehashte Version von "admin"
},
Ismail: {
username: "ismail",
password:
"$2a$10$WO/pzNjkkbC4X3aCEcwd2ugMHQ8Wzq0unCYNePTAL01ZrS/rEAcGu", // Gehashte Version von "ismail"
},
},
},
reducers: {
setAdminLoggedIn: (state, action) => {
state.isAdminLoggedIn = action.payload;
},
},
});
export const { setAdminLoggedIn } = authSlice.actions;
export default authSlice.reducer;