Skip to content

Commit c500e6d

Browse files
authored
check if room is empty if room_join is granted (#234)
1 parent ad40081 commit c500e6d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

livekit-api/src/access_token.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,11 @@ impl AccessToken {
184184
return Err(AccessTokenError::InvalidKeys);
185185
}
186186

187-
if self.claims.video.room_join && self.claims.sub.is_empty() {
187+
if self.claims.video.room_join
188+
&& (self.claims.sub.is_empty() || self.claims.video.room.is_empty())
189+
{
188190
return Err(AccessTokenError::InvalidClaims(
189-
"token grants room_join but doesn't have an identity",
191+
"token grants room_join but doesn't have an identity or room",
190192
));
191193
}
192194

0 commit comments

Comments
 (0)