mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 19:15:58 +01:00 
			
		
		
		
	Update csrf-sync to fallback to _csrf query param
This commit is contained in:
		| @@ -6,6 +6,13 @@ const { | ||||
| 	generateToken, | ||||
| 	csrfSynchronisedProtection, | ||||
| } = csrfSync({ | ||||
| 	getTokenFromRequest: (req) => { | ||||
| 		if (req.headers['x-csrf-token']) { | ||||
| 			return req.headers['x-csrf-token']; | ||||
| 		} else if (req.query) { | ||||
| 			return req.query._csrf; | ||||
| 		} | ||||
| 	}, | ||||
| 	size: 64, | ||||
| }); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user