Skip to content

Commit

Permalink
Necessary SOCKET_IO_ADMIN_UI_PASSWORD in production
Browse files Browse the repository at this point in the history
  • Loading branch information
TOMOFUMI-KONDO committed Jun 7, 2021
1 parent 001f19d commit dde7230
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion server/src/ioServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@ const createSocketIOServer = async (httpServer: HttpServer) => {
methods: ["GET", "POST"],
},
});
if (
process.env.NODE_ENV == "production" &&
process.env.SOCKET_IO_ADMIN_UI_PASSWORD === undefined
) {
throw Error("SOCKET_IO_ADMIN_UI_PASSWORD is not defined in production.");
}
const hashed = await generateHash(
process.env.SOCKET_IO_ADMIN_UI_PASSWORD as string
process.env.SOCKET_IO_ADMIN_UI_PASSWORD ?? ""
);
instrument(io, {
auth: {
Expand Down

0 comments on commit dde7230

Please sign in to comment.