htaccess + token bugfix

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

View File

@@ -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;
}

View File

@@ -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);