mirror of
https://github.com/thecyberlearn/quantum-ai-v3.git
synced 2026-08-18 21:12:56 +00:00
Update documentation with CSRF token requirements
- Add CSRF token section to Frontend JavaScript Requirements
- Document both manual FormData and HTML form approaches
- Clarify when {% csrf_token %} is needed in templates
- Reference recent data analyzer CSRF fix
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
179e473897
commit
09e1e3a74c
@ -494,6 +494,22 @@ The project uses a clean, modular individual agent architecture:
|
||||
- resetForm() // Prepares for next request
|
||||
```
|
||||
|
||||
#### CSRF Token Requirements
|
||||
All agent templates that use JavaScript form submission must include:
|
||||
```html
|
||||
<!-- Required: Add CSRF token to template -->
|
||||
{% csrf_token %}
|
||||
```
|
||||
|
||||
For manual FormData submission (like data analyzer), access token via:
|
||||
```javascript
|
||||
// For templates with {% csrf_token %} tag
|
||||
formData.append('csrfmiddlewaretoken', document.querySelector('[name=csrfmiddlewaretoken]').value);
|
||||
|
||||
// For HTML forms with {% csrf_token %} inside form
|
||||
const formData = new FormData(this); // 'this' refers to form element - automatically includes CSRF
|
||||
```
|
||||
|
||||
#### Template Requirements
|
||||
```html
|
||||
<!-- Required data attributes for wallet balance -->
|
||||
|
||||
Loading…
Reference in New Issue
Block a user