File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
packages/appwrite-utils-helpers/src/config/services Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -595,13 +595,24 @@ export class SessionAuthService {
595595 return null ;
596596 }
597597
598- const candidates = this . getSessionsForEndpoint ( prefs , endpoint ) ;
598+ let candidates = this . getSessionsForEndpoint ( prefs , endpoint ) ;
599599 if ( candidates . length === 0 ) {
600- logger . debug ( "No candidate sessions found for endpoint" , {
600+ logger . debug ( "No endpoint-matched sessions, trying all sessions as cross- endpoint fallback " , {
601601 prefix : "Session" ,
602602 endpoint,
603603 normalizedEndpoint : this . normalizeEndpoint ( endpoint )
604604 } ) ;
605+ // Fallback: try ALL sessions regardless of endpoint (handles custom domains like
606+ // appwrite.socialaize.com pointing to cloud.appwrite.io)
607+ candidates = Object . entries ( prefs )
608+ . filter ( ( [ key , data ] ) =>
609+ key !== 'current' &&
610+ typeof data === 'object' &&
611+ data ?. endpoint &&
612+ data ?. cookie
613+ ) as typeof candidates ;
614+ }
615+ if ( candidates . length === 0 ) {
605616 return null ;
606617 }
607618
You can’t perform that action at this time.
0 commit comments