diff --git a/lib/features/calls/data/livekit_service.dart b/lib/features/calls/data/livekit_service.dart index 2efdf8b..f4135f7 100644 --- a/lib/features/calls/data/livekit_service.dart +++ b/lib/features/calls/data/livekit_service.dart @@ -154,12 +154,13 @@ class LiveKitService { } final json = jsonDecode(response.body) as Map; - final token = json['token'] as String?; + // lk-jwt-service returns 'jwt' (not 'token') per Element spec + final token = (json['jwt'] ?? json['token']) as String?; final url = json['url'] as String?; if (token == null || url == null) { - debugPrint('[LiveKit] Response fields: ${json.keys.toList()}'); - return _JwtError('JWT response missing token or url fields.'); + debugPrint('[LiveKit] Response keys: ${json.keys.toList()}'); + return _JwtError('JWT response missing jwt or url. Got: ${json.keys}'); } debugPrint('[LiveKit] JWT obtained, LiveKit URL: $url');