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
RewriteRule ^api(/.*)?$ /index.php?api=$1 [L,QSA]
RewriteEngine On
RewriteOptions AllowNoSlash
RewriteRule ^files$ /files/ [L,QSA]
RewriteEngine On
RewriteOptions AllowNoSlash
RewriteRule ^((\.idea|\.git|src|test|core)(/.*)?)$ /index.php?site=$1 [L,QSA]

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

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