[PR #2207] [MERGED] fix(auth): remove unnecessary fields from JWT token payloads #3992

Closed
opened 2026-03-22 14:58:17 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-vikunja/vikunja/pull/2207
Author: @kolaente
Created: 2/8/2026
Status: Merged
Merged: 2/8/2026
Merged by: @kolaente

Base: mainHead: fix-remove-unnecessary-jwt-fields


📝 Commits (1)

  • 34bef46 fix(auth): remove unnecessary fields from JWT token payloads

📊 Changes

3 files changed (+0 additions, -16 deletions)

View changed files

📝 frontend/src/stores/auth.ts (+0 -1)
📝 pkg/modules/auth/auth.go (+0 -5)
📝 pkg/user/user.go (+0 -10)

📄 Description

Summary

  • Remove email, name, emailRemindersEnabled, and isLocalUser claims from user JWT tokens
  • Remove isLocalUser claim from link share JWT tokens
  • Simplify GetUserFromClaims to only extract id and username
  • Remove the now-unnecessary email override in the frontend's refreshUserInfo

These fields are never used from the token — the backend always fetches the full user from the database by ID, and the frontend fetches user data from the GET /user API endpoint immediately after login. Existing tokens with the old claims continue to work since extra fields are simply ignored.

Test plan

  • Backend web tests pass
  • go vet and go build pass on changed packages
  • Frontend lint passes
  • Manual login/logout flow works correctly
  • Link share access works correctly

🔄 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/2207 **Author:** [@kolaente](https://github.com/kolaente) **Created:** 2/8/2026 **Status:** ✅ Merged **Merged:** 2/8/2026 **Merged by:** [@kolaente](https://github.com/kolaente) **Base:** `main` ← **Head:** `fix-remove-unnecessary-jwt-fields` --- ### 📝 Commits (1) - [`34bef46`](https://github.com/go-vikunja/vikunja/commit/34bef46935b08a161146b3585a7661b8b52bbba9) fix(auth): remove unnecessary fields from JWT token payloads ### 📊 Changes **3 files changed** (+0 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/stores/auth.ts` (+0 -1) 📝 `pkg/modules/auth/auth.go` (+0 -5) 📝 `pkg/user/user.go` (+0 -10) </details> ### 📄 Description ## Summary - Remove `email`, `name`, `emailRemindersEnabled`, and `isLocalUser` claims from user JWT tokens - Remove `isLocalUser` claim from link share JWT tokens - Simplify `GetUserFromClaims` to only extract `id` and `username` - Remove the now-unnecessary email override in the frontend's `refreshUserInfo` These fields are never used from the token — the backend always fetches the full user from the database by ID, and the frontend fetches user data from the `GET /user` API endpoint immediately after login. Existing tokens with the old claims continue to work since extra fields are simply ignored. ## Test plan - [x] Backend web tests pass - [x] `go vet` and `go build` pass on changed packages - [x] Frontend lint passes - [ ] Manual login/logout flow works correctly - [ ] Link share access works correctly --- <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-03-22 14:58:17 -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#3992