[GH-ISSUE #2657] Token refresh fails when hosting in a subdirectory #6724

Closed
opened 2026-04-20 17:18:14 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @ceroma on GitHub (Apr 19, 2026).
Original GitHub issue: https://github.com/go-vikunja/vikunja/issues/2657

Pre-submission checklist

  • I have searched for existing open or closed issue reports with the same problem.

Description

The refresh token cookie is hard-coded to the /api/v1/user/token/refresh path:
56aef03697/pkg/modules/auth/auth.go (L51)

When running Vikunja in a subdirectory (https://vikunja.io/docs/running-vikunja-in-a-subdirectory/), this makes the token refresh call always fail with "No refresh token provided.". The cookie is never sent to <sub-path>/api/v1/user/token/refresh because of the path mismatch.

I guess one possible fix is to build the cookie path dynamically based on the requests' path? Or, alternatively, use the same env var VIKUNJA_FRONTEND_BASE to build the path?

Vikunja Version

v2.3.0

Browser and version

No response

Can you reproduce the bug on the Vikunja demo site?

No

Screenshots

No response

Originally created by @ceroma on GitHub (Apr 19, 2026). Original GitHub issue: https://github.com/go-vikunja/vikunja/issues/2657 ### Pre-submission checklist - [x] I have searched for existing open or closed issue reports with the same problem. ### Description The refresh token cookie is hard-coded to the `/api/v1/user/token/refresh` path: https://github.com/go-vikunja/vikunja/blob/56aef0369766268a6bf9a5c72f6e2b2ff0155c10/pkg/modules/auth/auth.go#L51 When running Vikunja in a subdirectory (https://vikunja.io/docs/running-vikunja-in-a-subdirectory/), this makes the token refresh call always fail with "No refresh token provided.". The cookie is never sent to `<sub-path>/api/v1/user/token/refresh` because of the path mismatch. I guess one possible fix is to build the cookie path dynamically based on the requests' path? Or, alternatively, use the same env var `VIKUNJA_FRONTEND_BASE` to build the path? ### Vikunja Version v2.3.0 ### Browser and version _No response_ ### Can you reproduce the bug on the Vikunja demo site? No ### Screenshots _No response_
GiteaMirror added the area/auth label 2026-04-20 17:18:14 -05:00
Author
Owner

@ceroma commented on GitHub (Apr 19, 2026):

I just figured out that I can rewrite the cookie's path with Nginx's proxy_cookie_path, but I'll leave the issue open in case you might want to update the subdirectory docs to mention this cookie.

<!-- gh-comment-id:4276715974 --> @ceroma commented on GitHub (Apr 19, 2026): I just figured out that I can rewrite the cookie's path with Nginx's `proxy_cookie_path`, but I'll leave the issue open in case you might want to update the subdirectory docs to mention this cookie.
Author
Owner

@kolaente commented on GitHub (Apr 20, 2026):

Will be fixed by https://github.com/go-vikunja/vikunja/pull/2588

<!-- gh-comment-id:4281614557 --> @kolaente commented on GitHub (Apr 20, 2026): Will be fixed by https://github.com/go-vikunja/vikunja/pull/2588
Author
Owner

@vikunja-bot-app[bot] commented on GitHub (Apr 20, 2026):

This issue has been fixed in #2588, please check with the next unstable build (should be ready for deployment in ~30min, also on the demo).

<!-- gh-comment-id:4281734095 --> @vikunja-bot-app[bot] commented on GitHub (Apr 20, 2026): This issue has been fixed in #2588, please check with the next unstable build (should be ready for deployment in ~30min, also on [the demo](https://try.vikunja.io)).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#6724