callAsyncJavaScript returns JS numbers as NSNumber (Double-backed). 'val as? Int' silently returns nil for 200.0, so onAuthenticated never fired. Fixed with 'val as? NSNumber then .intValue == 200'. Also switched content world from .defaultClient to .page so the fetch runs in the same JS context as the loaded page.