mirror of
https://github.com/sasjs/server.git
synced 2026-01-09 15:30:05 +00:00
fix: added CSRF check for granting access via session authentication
This commit is contained in:
@@ -7,6 +7,7 @@ import morgan from 'morgan'
|
||||
import cookieParser from 'cookie-parser'
|
||||
import dotenv from 'dotenv'
|
||||
import cors from 'cors'
|
||||
import helmet from 'helmet'
|
||||
|
||||
import {
|
||||
connectDB,
|
||||
@@ -37,6 +38,11 @@ export const cookieOptions = {
|
||||
***********************************/
|
||||
export const csrfProtection = csrf({ cookie: cookieOptions })
|
||||
|
||||
/***********************************
|
||||
* Handle security and origin *
|
||||
***********************************/
|
||||
app.use(helmet())
|
||||
|
||||
/***********************************
|
||||
* Enabling CORS *
|
||||
***********************************/
|
||||
|
||||
Reference in New Issue
Block a user