···124124125125 // Get the PDS endpoint from the 'iss' parameter in the callback URL
126126 // This is critical for third-party PDS authentication
127127- if (iss && iss.startsWith('https://')) {
127127+ if (typeof iss === 'string' && iss.startsWith('https://')) {
128128 console.log('Using iss from callback as PDS endpoint:', iss);
129129 tokenPdsEndpoint = iss;
130130 // Store this for later use