diff --git a/filemanager/src/App.vue b/filemanager/src/App.vue
index 15ec25994..92c902c0b 100644
--- a/filemanager/src/App.vue
+++ b/filemanager/src/App.vue
@@ -11,11 +11,11 @@ export default {
components: { ConfirmDialog },
data() {
return {
- accessToken: localStorage.accessToken || ''
+ accessToken: localStorage.token || ''
};
},
mounted() {
- if (!this.accessToken) this.$router.push('/login');
+ if (!this.accessToken) window.location.href = '/';
}
};
diff --git a/filemanager/src/main.js b/filemanager/src/main.js
index ae1071955..2a40a1f65 100644
--- a/filemanager/src/main.js
+++ b/filemanager/src/main.js
@@ -11,15 +11,13 @@ import ConfirmationService from 'primevue/confirmationservice';
import { createRouter, createWebHashHistory } from 'vue-router';
import App from './App.vue';
-import Login from './views/Login.vue';
import Home from './views/Home.vue';
import Viewer from './views/Viewer.vue';
const routes = [
{ path: '/', redirect: '/home' },
{ path: '/home/:type?/:resourceId?/:cwd*', component: Home },
- { path: '/viewer/:type/:resourceId/:filePath*', component: Viewer },
- { path: '/login', component: Login },
+ { path: '/viewer/:type/:resourceId/:filePath*', component: Viewer }
];
const router = createRouter({
diff --git a/filemanager/src/views/Home.vue b/filemanager/src/views/Home.vue
index 00257d078..e5e1f1792 100644
--- a/filemanager/src/views/Home.vue
+++ b/filemanager/src/views/Home.vue
@@ -37,7 +37,6 @@
-
@@ -206,10 +205,6 @@ export default {
this.cwd = '/';
this.loadResource(event.value);
},
- onLogout() {
- delete localStorage.accessToken;
- this.$router.push('/login');
- },
onSelectionChanged(items) {
this.activeItem = items[0] || null;
this.selectedItems = items;
@@ -287,7 +282,7 @@ export default {
},
async loadResource(resource) {
this.activeResource = resource;
- this.directoryModel = createDirectoryModel(BASE_URL, localStorage.accessToken, resource.type === 'volume' ? `volumes/${resource.id}` : `apps/${resource.id}`);
+ this.directoryModel = createDirectoryModel(BASE_URL, this.accessToken, resource.type === 'volume' ? `volumes/${resource.id}` : `apps/${resource.id}`);
this.loadCwd();
}
},
@@ -295,7 +290,7 @@ export default {
useConfirm();
// load all apps
- let [error, result] = await safe(superagent.get(`${BASE_URL}/api/v1/apps`).query({ access_token: localStorage.accessToken }));
+ let [error, result] = await safe(superagent.get(`${BASE_URL}/api/v1/apps`).query({ access_token: this.accessToken }));
if (error) {
console.error('Failed to list apps', error);
this.apps = [];
@@ -305,7 +300,7 @@ export default {
this.apps.forEach(function (a) { a.type = 'app'; a.label = a.fqdn; });
// load all volumes
- [error, result] = await safe(superagent.get(`${BASE_URL}/api/v1/volumes`).query({ access_token: localStorage.accessToken }));
+ [error, result] = await safe(superagent.get(`${BASE_URL}/api/v1/volumes`).query({ access_token: this.accessToken }));
if (error) {
console.error('Failed to list volumes', error);
this.volumes = [];
diff --git a/filemanager/src/views/Login.vue b/filemanager/src/views/Login.vue
deleted file mode 100644
index b2d4760be..000000000
--- a/filemanager/src/views/Login.vue
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
-
-
-
-
-