martenframework / marten

The pragmatic web framework.
https://martenframework.com
MIT License
396 stars 21 forks source link

Add `{% csrf %}` shorthand #190

Closed notramo closed 4 months ago

notramo commented 4 months ago

Since the CSRF token is mostly used in <form> elements in a hidden input, it would be useful to add a {% csrf %} template tag, which renders a hidden input:

<input type=hidden name=csrftoken value="#{csrf_token}">