Skip to content

Commit

Permalink
Merge pull request #8 from AbdulGhani002/autofix/alert-31-0737dc014d
Browse files Browse the repository at this point in the history
Fix code scanning alert no. 31: Missing CSRF middleware
  • Loading branch information
AbdulGhani002 authored Sep 24, 2024
2 parents 163ca84 + a4a047d commit 9a85a33
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
if: matrix.language == 'javascript-typescript'
run: |
# Install Node.js dependencies
npm install
npm install && npm start
- name: Build the project
if: matrix.language == 'javascript-typescript'
Expand Down
2 changes: 2 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const authRoutes = require("./routes/auth.routes");
const accountRoutes = require("./routes/account.routes");
const cookieParser = require("cookie-parser");
const {checkUser} = require("./middlewares/auth-middleware");
const csrf = require('lusca').csrf;

const errorHandlerMiddleware = require("./middlewares/error-handler");

Expand All @@ -18,6 +19,7 @@ app.use(express.static("public"));
app.use(express.static("pictures"));
app.use(express.urlencoded({ extended: true }));
app.use(cookieParser());
app.use(csrf());

app.get("*",checkUser);
app.use(baseRoutes);
Expand Down

0 comments on commit 9a85a33

Please sign in to comment.