summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorhaturatu <taro@eyes4you.org>2025-10-13 07:01:46 +0900
committerhaturatu <taro@eyes4you.org>2025-10-13 07:01:46 +0900
commitaf646a893e3b66b2b868d2d0f4216362477a4fba (patch)
tree4be49ae0140cb5b9849831333cbdccb0fdd279cc /templates
parent18991704b375db4e8d22785bb47f3e2e12cd016f (diff)
support: xsrf
Diffstat (limited to 'templates')
-rw-r--r--templates/account_password.html2
-rw-r--r--templates/admin.html2
-rw-r--r--templates/js/admin.js4
-rw-r--r--templates/login.html2
-rw-r--r--templates/php/account_password.php2
-rw-r--r--templates/php/login.php2
-rw-r--r--templates/php/register.php2
-rw-r--r--templates/register.html2
8 files changed, 9 insertions, 9 deletions
diff --git a/templates/account_password.html b/templates/account_password.html
index 68fb95f..e4f1494 100644
--- a/templates/account_password.html
+++ b/templates/account_password.html
@@ -11,7 +11,7 @@
<div class="container content-container">
<h2>Change Password</h2>
<form id="change-password-form" action="{{.Paths.AccountPassword}}" method="post">
- <input type="hidden" name="gorilla.csrf.Token" value="{{.CSRFToken}}">
+ <input type="hidden" name="xsrf_token" value="{{ .XSRFToken }}">
<div class="form-group">
<label for="current_password">Current Password</label>
<input type="password" id="current_password" name="current_password" required>
diff --git a/templates/admin.html b/templates/admin.html
index c2f9488..6c08132 100644
--- a/templates/admin.html
+++ b/templates/admin.html
@@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="csrf-token" content="{{.CSRFToken}}">
+ <meta name="xsrf-token" content="{{.XSRFToken}}">
<title>Admin Dashboard</title>
<link rel="stylesheet" href="{{.Paths.Assets}}/css/style.css">
<link rel="stylesheet" href="{{.Paths.Assets}}/css/admin.css">
diff --git a/templates/js/admin.js b/templates/js/admin.js
index 0b26e2f..fa67985 100644
--- a/templates/js/admin.js
+++ b/templates/js/admin.js
@@ -7,11 +7,11 @@
* @returns {Promise<Response>}
*/
async function fetchApi(url, options = {}) {
- const csrfToken = document.querySelector('meta[name="csrf-token"]').getAttribute('content');
+ const xsrfToken = document.querySelector('meta[name="xsrf-token"]').getAttribute('content');
options.headers = {
...options.headers,
- 'X-CSRF-Token': csrfToken
+ 'X-XSRF-Token': xsrfToken
};
// Set content type for methods that have a body.
diff --git a/templates/login.html b/templates/login.html
index b2f847c..653a77c 100644
--- a/templates/login.html
+++ b/templates/login.html
@@ -10,7 +10,7 @@
<div class="container form-container">
<h2>Login Required</h2>
<form id="login-form" action="{{.Paths.Login}}" method="post">
- <input type="hidden" name="gorilla.csrf.Token" value="{{.CSRFToken}}">
+ <input type="hidden" name="xsrf_token" value="{{ .XSRFToken }}">
<div class="form-group">
<label for="username">Username</label>
<input type="text" id="username" name="username" required>
diff --git a/templates/php/account_password.php b/templates/php/account_password.php
index 8a1871d..a68493f 100644
--- a/templates/php/account_password.php
+++ b/templates/php/account_password.php
@@ -18,7 +18,7 @@
<div class="container content-container">
<h2>Change Password</h2>
<form id="change-password-form" action="<?php echo htmlspecialchars($paths['AccountPassword']); ?>" method="post">
- <input type="hidden" name="gorilla.csrf.Token" value="<?php echo htmlspecialchars($_SERVER['HTTP_X_CSRF_TOKEN']); ?>">
+ <input type="hidden" name="xsrf_token" value="<?php echo htmlspecialchars($_SERVER['HTTP_X_XSRF_TOKEN']); ?>">
<div class="form-group">
<label for="current_password">Current Password</label>
<input type="password" id="current_password" name="current_password" required>
diff --git a/templates/php/login.php b/templates/php/login.php
index c4644ef..67b075e 100644
--- a/templates/php/login.php
+++ b/templates/php/login.php
@@ -17,7 +17,7 @@
<div class="container form-container">
<h2>Login Required</h2>
<form id="login-form" action="<?php echo htmlspecialchars($paths['Login']); ?>" method="post">
- <input type="hidden" name="gorilla.csrf.Token" value="<?php echo htmlspecialchars($_SERVER['HTTP_X_CSRF_TOKEN']); ?>">
+ <input type="hidden" name="xsrf_token" value="<?php echo htmlspecialchars($_SERVER['HTTP_X_XSRF_TOKEN']); ?>">
<div class="form-group">
<label for="username">Username</label>
<input type="text" id="username" name="username" required>
diff --git a/templates/php/register.php b/templates/php/register.php
index 31edf25..f05e89c 100644
--- a/templates/php/register.php
+++ b/templates/php/register.php
@@ -17,7 +17,7 @@
<div class="container form-container">
<h2>Create Account</h2>
<form id="register-form" action="<?php echo htmlspecialchars($paths['Register']); ?>" method="post">
- <input type="hidden" name="gorilla.csrf.Token" value="<?php echo htmlspecialchars($_SERVER['HTTP_X_CSRF_TOKEN']); ?>">
+ <input type="hidden" name="xsrf_token" value="<?php echo htmlspecialchars($_SERVER['HTTP_X_XSRF_TOKEN']); ?>">
<div class="form-group">
<label for="username">Username</label>
<input type="text" id="username" name="username" required>
diff --git a/templates/register.html b/templates/register.html
index 7db7972..f46fbe0 100644
--- a/templates/register.html
+++ b/templates/register.html
@@ -10,7 +10,7 @@
<div class="container form-container">
<h2>Create Account</h2>
<form id="register-form" action="{{.Paths.Register}}" method="post">
- <input type="hidden" name="gorilla.csrf.Token" value="{{.CSRFToken}}">
+ <input type="hidden" name="xsrf_token" value="{{ .XSRFToken }}">
<div class="form-group">
<label for="username">Username</label>
<input type="text" id="username" name="username" required>