htaccess + token bugfix

This commit is contained in:
Roman Hergenreder 2021-01-14 23:41:16 +01:00
parent e909e7b221
commit 518045e238
4 changed files with 10 additions and 3 deletions

@ -6,6 +6,10 @@ DirectorySlash Off
RewriteEngine On RewriteEngine On
RewriteRule ^api(/.*)?$ /index.php?api=$1 [L,QSA] RewriteRule ^api(/.*)?$ /index.php?api=$1 [L,QSA]
RewriteEngine On
RewriteOptions AllowNoSlash
RewriteRule ^files$ /files/ [L,QSA]
RewriteEngine On RewriteEngine On
RewriteOptions AllowNoSlash RewriteOptions AllowNoSlash
RewriteRule ^((\.idea|\.git|src|test|core)(/.*)?)$ /index.php?site=$1 [L,QSA] RewriteRule ^((\.idea|\.git|src|test|core)(/.*)?)$ /index.php?site=$1 [L,QSA]

@ -8,8 +8,6 @@ export default class API {
} }
csrfToken() { csrfToken() {
console.log(this.loggedIn);
console.log(this.user);
return this.loggedIn ? this.user.session.csrf_token : null; return this.loggedIn ? this.user.session.csrf_token : null;
} }

@ -118,6 +118,7 @@ class FileControlPanel extends React.Component {
} }
newState.files = res.files; newState.files = res.files;
} else { } else {
newState.token.value = (newState.token.value ? "" : token);
newState.errorMessage = res.msg; newState.errorMessage = res.msg;
} }
@ -137,6 +138,10 @@ class FileControlPanel extends React.Component {
let checkUser = true; let checkUser = true;
let pathName = window.location.pathname; let pathName = window.location.pathname;
if (pathName.startsWith("/files")) {
pathName = pathName.substr("/files".length);
}
if (pathName.length > 1) { if (pathName.length > 1) {
let end = (pathName.endsWith("/") ? pathName.length - 2 : pathName.length - 1); let end = (pathName.endsWith("/") ? pathName.length - 2 : pathName.length - 1);
let start = (pathName.startsWith("/files/") ? ("/files/").length : 1); let start = (pathName.startsWith("/files/") ? ("/files/").length : 1);

2
js/files.min.js vendored

File diff suppressed because one or more lines are too long