this repo has no description
atproto bluesky typescript express

added a warning about SESSION_SECRET being undefined

+9 -3
+9 -3
src/index.ts
··· 16 16 17 17 import { registerHelpers } from "./helpers/registerHelpers.js"; 18 18 19 - export const app: Express = express(); 19 + const app: Express = express(); 20 + const randomSecret = crypto.randomBytes(32).toString("hex"); 20 21 21 22 registerHelpers(); 22 23 ··· 56 57 app.use( 57 58 expressSession({ 58 59 name: "sid", 59 - secret: SESSION_SECRET || crypto.randomBytes(32).toString("hex"), 60 + secret: SESSION_SECRET || randomSecret, 60 61 resave: false, 61 62 saveUninitialized: false, 62 63 cookie: { ··· 80 81 app.use("/xrpc", api); 81 82 82 83 app.listen(PORT, () => { 83 - console.log(`[server]: Server is running at ${PUBLIC_URL}`); 84 + console.log(`[server] Server is running at ${PUBLIC_URL}`); 85 + if (!SESSION_SECRET) { 86 + console.warn( 87 + "[warning] SESSION_SECRET is not set. Sessions might not work properly,", 88 + ); 89 + } 84 90 });