Implement new JWT auth

This commit is contained in:
advplyr 2025-06-29 17:22:58 -05:00
parent e384863148
commit 4f5123e842
21 changed files with 739 additions and 56 deletions

View file

@ -112,6 +112,10 @@ class User extends Model {
this.updatedAt
/** @type {import('./MediaProgress')[]?} - Only included when extended */
this.mediaProgresses
// Temporary accessToken, not stored in database
/** @type {string} */
this.accessToken
}
// Excludes "root" since their can only be 1 root user
@ -520,7 +524,9 @@ class User extends Model {
username: this.username,
email: this.email,
type: this.type,
// TODO: Old non-expiring token
token: this.type === 'root' && hideRootToken ? '' : this.token,
accessToken: this.accessToken || null,
mediaProgress: this.mediaProgresses?.map((mp) => mp.getOldMediaProgress()) || [],
seriesHideFromContinueListening: [...seriesHideFromContinueListening],
bookmarks: this.bookmarks?.map((b) => ({ ...b })) || [],