Always store CSRF token for each page in Vue.js theme
so child components don't have to "redefine" it. at least, those that know about the page already having it...
This commit is contained in:
		
							parent
							
								
									8ff69e8eda
								
							
						
					
					
						commit
						4a35c231f8
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		| 
						 | 
					@ -35,7 +35,10 @@
 | 
				
			||||||
        methods: {}
 | 
					        methods: {}
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    let ThisPageData = {}
 | 
					    let ThisPageData = {
 | 
				
			||||||
 | 
					        ## TODO: should find a better way to handle CSRF token
 | 
				
			||||||
 | 
					        csrftoken: ${json.dumps(request.session.get_csrf_token() or request.session.new_csrf_token())|n},
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  </script>
 | 
					  </script>
 | 
				
			||||||
</%def>
 | 
					</%def>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue