tangled
alpha
login
or
join now
yoyle.city
/
skittr
6
fork
atom
this repo has no description
atproto
bluesky
typescript
express
6
fork
atom
overview
issues
3
pulls
pipelines
added a warning about SESSION_SECRET being undefined
lime360
4 months ago
1cb18b12
f1cf187d
1/1
test.yml
success
26s
+9
-3
1 changed file
expand all
collapse all
unified
split
src
index.ts
+9
-3
src/index.ts
···
16
16
17
17
import { registerHelpers } from "./helpers/registerHelpers.js";
18
18
19
19
-
export const app: Express = express();
19
19
+
const app: Express = express();
20
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
59
-
secret: SESSION_SECRET || crypto.randomBytes(32).toString("hex"),
60
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
83
-
console.log(`[server]: Server is running at ${PUBLIC_URL}`);
84
84
+
console.log(`[server] Server is running at ${PUBLIC_URL}`);
85
85
+
if (!SESSION_SECRET) {
86
86
+
console.warn(
87
87
+
"[warning] SESSION_SECRET is not set. Sessions might not work properly,",
88
88
+
);
89
89
+
}
84
90
});