[PR #1119] [MERGED] fix: don't panic when using api token when not correctly put into context #4714

Closed
opened 2026-04-16 13:13:47 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-vikunja/vikunja/pull/1119
Author: @kolaente
Created: 7/14/2025
Status: Merged
Merged: 7/15/2025
Merged by: @kolaente

Base: mainHead: codex/analyze-and-fix-internal-server-error


📝 Commits (2)

  • 381bd23 fix(api): resolve panic when using api tokens
  • f121d1b refactor

📊 Changes

3 files changed (+49 additions, -1 deletions)

View changed files

📝 pkg/routes/api_tokens.go (+7 -0)
📝 pkg/user/error.go (+27 -0)
📝 pkg/user/user.go (+15 -1)

📄 Description

Summary

  • prevent panic by loading the token owner into request context
  • use the context user object in GetCurrentUser

Testing

  • mage lint:fix

https://chatgpt.com/codex/tasks/task_e_687577d0cec88322a07b3eabd96decf9


🔄 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/1119 **Author:** [@kolaente](https://github.com/kolaente) **Created:** 7/14/2025 **Status:** ✅ Merged **Merged:** 7/15/2025 **Merged by:** [@kolaente](https://github.com/kolaente) **Base:** `main` ← **Head:** `codex/analyze-and-fix-internal-server-error` --- ### 📝 Commits (2) - [`381bd23`](https://github.com/go-vikunja/vikunja/commit/381bd235b956d35bd3f92cc013239c790233d19a) fix(api): resolve panic when using api tokens - [`f121d1b`](https://github.com/go-vikunja/vikunja/commit/f121d1bae0724f1d3edea660f986ea39b8ba9888) refactor ### 📊 Changes **3 files changed** (+49 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `pkg/routes/api_tokens.go` (+7 -0) 📝 `pkg/user/error.go` (+27 -0) 📝 `pkg/user/user.go` (+15 -1) </details> ### 📄 Description ## Summary - prevent panic by loading the token owner into request context - use the context user object in `GetCurrentUser` ## Testing - `mage lint:fix` ------ https://chatgpt.com/codex/tasks/task_e_687577d0cec88322a07b3eabd96decf9 --- <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:13:47 -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#4714