mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-02 20:30:10 +00:00
Remove redundant id field from JWT payloads
Drop the duplicated `id` alias from JWT payloads and related token generation across auth providers and endpoints. The TokenPayload interface no longer includes `id`; middleware now derives `user.id` from `sub` when attaching the authenticated user to requests. Update tests accordingly. This reduces redundancy and ensures the canonical user identifier is `sub`.
This commit is contained in:
@@ -17,7 +17,6 @@ describe('JWT utilities', () => {
|
||||
it('generates and verifies access tokens', () => {
|
||||
const token = generateAccessToken({
|
||||
sub: 'user-1',
|
||||
id: 'user-1',
|
||||
plexId: 'plex-1',
|
||||
username: 'user',
|
||||
role: 'admin',
|
||||
@@ -58,7 +57,6 @@ describe('JWT utilities', () => {
|
||||
it('decodes tokens without verification', () => {
|
||||
const token = generateAccessToken({
|
||||
sub: 'user-4',
|
||||
id: 'user-4',
|
||||
plexId: 'plex-4',
|
||||
username: 'user',
|
||||
role: 'user',
|
||||
|
||||
Reference in New Issue
Block a user