fix: repair SSO auto-login and remove repo artifacts
- Add missing fetchT dep to session-handlers.js (fixes ctx is not defined error that broke jellyfin/emby/plex/syncthing SSO) - Replace all ctx.fetchT calls with direct fetchT usage - Remove server-old.js (69K monolith backup) from tracking - Remove AI-generated doc artifacts from repo root - Update .gitignore to prevent re-adding these files Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
const { SESSION_TTL, APP, PLEX, TIMEOUTS, buildMediaAuth } = require('../../constants');
|
||||
const { createCache, CACHE_CONFIGS } = require('../../cache-config');
|
||||
|
||||
module.exports = function({ authManager, credentialManager, asyncHandler, errorResponse, log }) {
|
||||
module.exports = function({ authManager, credentialManager, fetchT, asyncHandler, errorResponse, log }) {
|
||||
// App session cache for auto-login
|
||||
/**
|
||||
* Auth session handlers routes factory
|
||||
@@ -71,7 +71,7 @@ module.exports = function({ authManager, credentialManager, asyncHandler, errorR
|
||||
case 'emby': {
|
||||
const mediaAuth = buildMediaAuth(APP.DEVICE_IDS.SSO);
|
||||
try {
|
||||
const authResp = await ctx.fetchT(`${baseUrl}/Users/AuthenticateByName`, {
|
||||
const authResp = await fetchT(`${baseUrl}/Users/AuthenticateByName`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json', 'X-Emby-Authorization': mediaAuth },
|
||||
body: JSON.stringify({ Username: username, Pw: password }),
|
||||
@@ -95,7 +95,7 @@ module.exports = function({ authManager, credentialManager, asyncHandler, errorR
|
||||
}
|
||||
case 'plex': {
|
||||
try {
|
||||
const plexResp = await ctx.fetchT(PLEX.AUTH_URL, {
|
||||
const plexResp = await fetchT(PLEX.AUTH_URL, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Accept': 'application/json', 'Content-Type': 'application/json',
|
||||
@@ -127,7 +127,7 @@ module.exports = function({ authManager, credentialManager, asyncHandler, errorR
|
||||
}
|
||||
|
||||
try {
|
||||
const resp = await ctx.fetchT(loginUrl, {
|
||||
const resp = await fetchT(loginUrl, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': contentType, ...extraHeaders },
|
||||
body: loginBody, redirect: 'manual',
|
||||
|
||||
Reference in New Issue
Block a user