From 14acf30cd27fc00b1a744e2c26c101a70d61c9ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?The=CC=81o=20Monnom?= Date: Thu, 9 Nov 2023 10:04:33 -0800 Subject: [PATCH] Update access_token.rs --- livekit-api/src/access_token.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/livekit-api/src/access_token.rs b/livekit-api/src/access_token.rs index fc2652fb..64185817 100644 --- a/livekit-api/src/access_token.rs +++ b/livekit-api/src/access_token.rs @@ -184,9 +184,11 @@ impl AccessToken { return Err(AccessTokenError::InvalidKeys); } - if self.claims.video.room_join && self.claims.sub.is_empty() { + if self.claims.video.room_join + && (self.claims.sub.is_empty() || self.claims.video.room.is_empty()) + { return Err(AccessTokenError::InvalidClaims( - "token grants room_join but doesn't have an identity", + "token grants room_join but doesn't have an identity or room", )); }