feat: auth by default, theme toggle, CoderPad startup, review fixes
- Require a session on every route; public routes opt out with @allow_anonymous - Split password hashing and pepper loading into passwords.py - Add a system/light/dark theme toggle backed by light-dark() colors - Ignore stale 401s from an earlier session, PATCH only changed book fields, and block overlapping journal-entry saves - Add bin/start and CoderPad Vite server settings for the pad's start/restart - Rewrite README as a mise onboarding guide; expand .gitignore - Include review-round fixes and tests
This commit is contained in:
+24
-7
@@ -1,14 +1,31 @@
|
||||
/// <reference types="vitest/config" />
|
||||
import { defineConfig } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
import tailwindcss from '@tailwindcss/vite'
|
||||
|
||||
import tailwindcss from "@tailwindcss/vite";
|
||||
import react from "@vitejs/plugin-react";
|
||||
import { createLogger, defineConfig } from "vite";
|
||||
|
||||
// Set only inside a CoderPad pad, whose preview proxies port 3000 and the HMR websocket.
|
||||
const padHost = process.env.PROJECTS_BASE_HOST;
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react(), tailwindcss()],
|
||||
server: { proxy: { '/api': 'http://127.0.0.1:5000' } },
|
||||
server: {
|
||||
proxy: { "/api": { target: "http://127.0.0.1:5000", changeOrigin: true } },
|
||||
...(padHost
|
||||
? {
|
||||
host: "0.0.0.0",
|
||||
port: 3000,
|
||||
hmr: { clientPort: Number(process.env.WEBSOCKET_PORT) },
|
||||
allowedHosts: [`.${padHost}`],
|
||||
}
|
||||
: {}),
|
||||
},
|
||||
...(padHost
|
||||
? { customLogger: createLogger("info", { prefix: "[coderpad]" }) }
|
||||
: {}),
|
||||
test: {
|
||||
environment: 'jsdom',
|
||||
setupFiles: ['./src/test/setup.ts'],
|
||||
environment: "jsdom",
|
||||
setupFiles: ["./src/test/setup.ts"],
|
||||
unstubGlobals: true,
|
||||
},
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user