diff --git a/CHANGELOG.md b/CHANGELOG.md index 490d1bea2a..d04e8c102d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. For commit guidelines, please refer to [Standard Version](https://github.com/conventional-changelog/standard-version). +## v1.2.7-beta + + **BugFixes**: + - head > title > infinitely duplicating titles (#2016) + - Proxy auth not working with Nginx, stuck at logo (#2013) + ## v1.2.6-beta **Security**: diff --git a/frontend/src/api/commands.js b/frontend/src/api/commands.js deleted file mode 100644 index 9b52afdf40..0000000000 --- a/frontend/src/api/commands.js +++ /dev/null @@ -1,12 +0,0 @@ -import { globalVars } from "@/utils/constants"; - -const ssl = window.location.protocol === "https:"; -const protocol = ssl ? "wss:" : "ws:"; - -export default function command(url, command, onmessage, onclose) { - url = `${protocol}//${window.location.host}${globalVars.baseURL}api/command${url}`; - let conn = new window.WebSocket(url); - conn.onopen = () => conn.send(command); - conn.onmessage = onmessage; - conn.onclose = onclose; -} diff --git a/frontend/src/api/users.js b/frontend/src/api/users.js index b9ea37947d..a3cc0525e0 100644 --- a/frontend/src/api/users.js +++ b/frontend/src/api/users.js @@ -1,6 +1,7 @@ import { fetchURL, fetchJSON } from '@/api/utils' import { getApiPath, getPublicApiPath } from '@/utils/url.js' import { notify } from '@/notify' // Import notify for error handling + export async function getAllUsers() { try { const apiPath = getApiPath('api/users') diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index d092ee5cbc..ef890642fb 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -11,10 +11,10 @@ import { mutations } from "@/store"; import { validateLogin } from "@/utils/auth"; import i18n from "@/i18n"; + const titles = { Login: i18n.global.t("general.login"), Share: i18n.global.t("general.share"), - PublicShare: i18n.global.t("general.share"), Files: i18n.global.t("general.files"), Tools: i18n.global.t("general.tool"), Settings: i18n.global.t("general.settings"), @@ -180,11 +180,12 @@ router.beforeResolve(async (to, from, next) => { to.matched.some((record) => record.meta.requiresAuth) || to.matched.some((record) => record.meta.optionalAuth) ) { + const isPublicRoute = to.path.startsWith("/public"); if (state?.user?.username) { // do nothing, user is already set } else { try { - await validateLogin(); + await validateLogin(isPublicRoute); } catch (error) { mutations.setCurrentUser(getters.anonymous()); } diff --git a/frontend/src/store/types.ts b/frontend/src/store/types.ts index e5c017ab7f..13745c6929 100644 --- a/frontend/src/store/types.ts +++ b/frontend/src/store/types.ts @@ -76,7 +76,6 @@ export interface UserObject { rules?: any[]; lockPassword?: boolean; hideDotfiles?: boolean; - commands?: string[]; sorting?: { by: string; asc: boolean; diff --git a/frontend/src/utils/auth.js b/frontend/src/utils/auth.js index 3932fd8870..3ebc5df656 100644 --- a/frontend/src/utils/auth.js +++ b/frontend/src/utils/auth.js @@ -2,9 +2,12 @@ import { mutations, getters,state } from "@/store"; import { getApiPath, getPublicApiPath } from "@/utils/url.js"; import { globalVars } from "@/utils/constants"; -export async function validateLogin() { +export async function validateLogin(isPublicRoute = false) { // Use direct fetch to avoid automatic logout on 401 - let apiPath = getPublicApiPath('users', { id: 'self' }); + // Public routes (e.g. /public/share/...) use the public API base path + const apiPath = isPublicRoute + ? getPublicApiPath('users', { id: 'self' }) + : getApiPath('/api/users', { id: 'self' }); const res = await fetch(apiPath, { credentials: 'same-origin', // Ensure cookies are sent with the request headers: { diff --git a/frontend/src/views/Files.vue b/frontend/src/views/Files.vue index c5d1525b74..befaac15e2 100644 --- a/frontend/src/views/Files.vue +++ b/frontend/src/views/Files.vue @@ -356,8 +356,7 @@ export default { // Display initial data immediately mutations.replaceRequest(file); - document.title = `${document.title} - ${file.name}`; - + document.title = globalVars.name + " - " + this.$t("general.share") + " - " + file.name; // Second pass: If directory has metadata available, fetch again with metadata IN THE BACKGROUND if (file.type === "directory" && file.hasMetadata) { this.loadingProgress = 90; @@ -476,7 +475,7 @@ export default { if (state.sources.count > 1) { mutations.setCurrentSource(data.source); } - document.title = `${document.title} - ${res.name}`; + document.title = globalVars.name + " - " + this.$t("general.files") + " - " + res.name; // Display initial data immediately and clear loading spinner mutations.replaceRequest(data);