Created a CSRF token system (#526)

* Implement a basic CSRF token system

* Update forms for all modules

* Added to the theme forms

* Create a config option for CSRF prevention

* Slightly rework the filter

* Let's actually use a global var

* Added the token to API hrefs

* Fixup

* Remove old reference

* Added the token to the installer twig globals

* The token isn't actually needed in the installer

* Fix client searching

* Whoops - those need quotes
This commit is contained in:
Belle Aerni authored and GitHub committed 2022-12-06 18:47:14 +01:00
1 parent 5979a6bfb0
commit 8821d50cff
122 files changed
+326 -110

No files matched your search

@@ -52,6 +52,7 @@
<div class="row-fluid">
<div class="span3">
<form action="" method="post" class="form-inline api-form" data-api-url="{{ 'api/client/invoice/funds_invoice'|link }}" data-api-jsonp="onAfterInvoiceCreated">
<input type="hidden" name="CSRFToken" value="{{ CSRFToken }}"/>
<fieldset>
<div class="control-group">
<div class="form-controls">
@@ -31,6 +31,7 @@
<p>{{ 'Keep your personal data up to date.'|trans }}</p>
</header>
<form method="post" action="" id="profile-update" class="form-horizontal">
<input type="hidden" name="CSRFToken" value="{{ CSRFToken }}"/>
<fieldset>
<div class="alert alert-block alert-success">
<div class="row">
@@ -184,6 +185,7 @@
<p>{{ 'Please enter new password two times in order avoid mistypes'|trans }}</p>
</header>
<form method="post" action="" id="change-password" class="form-horizontal">
<input type="hidden" name="CSRFToken" value="{{ CSRFToken }}"/>
<fieldset>
<div class="control-group">
<label class="control-label" for="input">{{ 'Password'|trans }}</label>
@@ -210,6 +212,7 @@
<p>{{ 'API key allows integration with external applications. You will need this key for authentication.'|trans }}</p>
</header>
<form method="post" action="" id="change-api-key" class="form-horizontal">
<input type="hidden" name="CSRFToken" value="{{ CSRFToken }}"/>
<fieldset>
<div class="alert alert-block">
<h4><p>{{ 'Warning! Resetting the key will break existing applications using it!'|trans }}</p></h4>