[PR #2587] fix: Frontend hard coded api base #5753

Open
opened 2026-04-16 13:51:14 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-vikunja/vikunja/pull/2587
Author: @mdrkrg
Created: 4/10/2026
Status: 🔄 Open

Base: mainHead: fix/frontend-hard-coded-api-base


📝 Commits (5)

  • c0d0081 fix(frontend): Make sw.ts respect to frontend base URL
  • 733f873 fix(frontend): Fix hard-coded API base in checkAndSetApiUrl.ts
  • c8bf7c8 fix(frontend/vite): Configure vite dev proxy to handle frontend path
  • ae6b5da fix(frontend/oidc): Prefix frontend base to redirect URL
  • dffbbd6 fix(tasks): Let getCommentUrl handle frontendUrl including sub-path

📊 Changes

5 files changed (+46 additions, -22 deletions)

View changed files

📝 frontend/src/components/tasks/partials/Comments.vue (+3 -1)
📝 frontend/src/helpers/checkAndSetApiUrl.ts (+27 -18)
📝 frontend/src/helpers/redirectToProvider.ts (+3 -1)
📝 frontend/src/sw.ts (+3 -1)
📝 frontend/vite.config.ts (+10 -1)

📄 Description

Porting stale changes from #2436, this mainly focus on the frontend.

What changed

  • checkAndSetApiUrl.ts: Extracted API_DEFAULT_PATH constant and joinPath/hasApiPath helpers.
  • redirectToProvider.ts: OIDC redirect URL now includes the base path via getFullBaseUrl(), so the callback lands on a route the Vue router handles.
  • sw.ts: Service worker API route regex is anchored to the configured base path instead of matching api/v1/ anywhere in the URL.
  • vite.config.ts: Made the dev proxy path and rewrite dynamic based on VIKUNJA_FRONTEND_BASE so local development works with a subpath.
  • Comments.vue: Let getCommentUrl handle frontendUrl including sub-path.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-vikunja/vikunja/pull/2587 **Author:** [@mdrkrg](https://github.com/mdrkrg) **Created:** 4/10/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/frontend-hard-coded-api-base` --- ### 📝 Commits (5) - [`c0d0081`](https://github.com/go-vikunja/vikunja/commit/c0d00813f678afd0f4919beb2f750faff19f6a18) fix(frontend): Make sw.ts respect to frontend base URL - [`733f873`](https://github.com/go-vikunja/vikunja/commit/733f8733a621b2635c8660a9687dda4d2996a44b) fix(frontend): Fix hard-coded API base in checkAndSetApiUrl.ts - [`c8bf7c8`](https://github.com/go-vikunja/vikunja/commit/c8bf7c8a48bf423b15a2f920adb84529c84b8e3f) fix(frontend/vite): Configure vite dev proxy to handle frontend path - [`ae6b5da`](https://github.com/go-vikunja/vikunja/commit/ae6b5da57d67a84663cbe6a90acc6ef908bfcd1b) fix(frontend/oidc): Prefix frontend base to redirect URL - [`dffbbd6`](https://github.com/go-vikunja/vikunja/commit/dffbbd654a2aa5d14f92e1c3584d9885d8ef9703) fix(tasks): Let getCommentUrl handle frontendUrl including sub-path ### 📊 Changes **5 files changed** (+46 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/components/tasks/partials/Comments.vue` (+3 -1) 📝 `frontend/src/helpers/checkAndSetApiUrl.ts` (+27 -18) 📝 `frontend/src/helpers/redirectToProvider.ts` (+3 -1) 📝 `frontend/src/sw.ts` (+3 -1) 📝 `frontend/vite.config.ts` (+10 -1) </details> ### 📄 Description Porting stale changes from #2436, this mainly focus on the frontend. ## What changed - `checkAndSetApiUrl.ts`: Extracted `API_DEFAULT_PATH` constant and `joinPath`/`hasApiPath` helpers. - `redirectToProvider.ts`: OIDC redirect URL now includes the base path via `getFullBaseUrl()`, so the callback lands on a route the Vue router handles. - `sw.ts`: Service worker API route regex is anchored to the configured base path instead of matching `api/v1/` anywhere in the URL. - `vite.config.ts`: Made the dev proxy path and rewrite dynamic based on `VIKUNJA_FRONTEND_BASE` so local development works with a subpath. - `Comments.vue`: Let getCommentUrl handle frontendUrl including sub-path. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-16 13:51:14 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#5753