Switch auth to plain-text password env var (remove bcrypt)

- Replace ADMIN_PASSWORD_HASH with ADMIN_PASSWORD in auth route and docker-compose
- Remove bcryptjs / @types/bcryptjs dependencies
- Delete scripts/hashPassword.ts (no longer needed)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-21 22:05:42 -05:00
parent 7ef0509f2b
commit bcb8a95fae
16 changed files with 407 additions and 156 deletions

View File

@@ -14,6 +14,7 @@ interface RackState {
deleteRack: (id: string) => Promise<void>;
// Module CRUD (optimistic update helpers)
addModule: (rackId: string, data: Parameters<typeof apiClient.racks.addModule>[1]) => Promise<Module>;
moveModule: (moduleId: string, targetRackId: string, targetUPosition: number) => Promise<void>;
updateModuleLocal: (moduleId: string, data: Partial<Module>) => void;
removeModuleLocal: (moduleId: string) => void;
// Selection
@@ -68,6 +69,24 @@ export const useRackStore = create<RackState>((set, get) => ({
return module;
},
moveModule: async (moduleId, targetRackId, targetUPosition) => {
const updated = await apiClient.modules.move(moduleId, targetRackId, targetUPosition);
set((s) => {
// Remove from source rack, insert into target rack
const racks = s.racks.map((r) => ({
...r,
modules: r.modules.filter((m) => m.id !== moduleId),
}));
return {
racks: racks.map((r) =>
r.id === targetRackId
? { ...r, modules: [...r.modules, updated].sort((a, b) => a.uPosition - b.uPosition) }
: r
),
};
});
},
updateModuleLocal: (moduleId, data) => {
set((s) => ({
racks: s.racks.map((r) => ({