mirror of
				https://github.com/ae-utbm/sith.git
				synced 2025-11-03 10:33:06 +00:00 
			
		
		
		
	* Upgrade openapi-ts * Migrate openapi-ts settings to new version * Add csrf token to headers of all API calls * Force csrf token authentication on API routes
		
			
				
	
	
		
			10 lines
		
	
	
		
			235 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			10 lines
		
	
	
		
			235 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
import Cookies from "js-cookie";
 | 
						|
import type { CreateClientConfig } from "#openapi";
 | 
						|
 | 
						|
export const createClientConfig: CreateClientConfig = (config) => ({
 | 
						|
  ...config,
 | 
						|
  headers: {
 | 
						|
    "X-CSRFToken": Cookies.get("csrftoken"),
 | 
						|
  },
 | 
						|
});
 |