Hey there! Just to clarify, LiveKit strictly enforces token expiration when you first connect. So, if your token has expired (like after 5 seconds in your test), the server should actually reject that connection attempt. But once you're already connected, the server can send refreshed tokens to keep your session going, which might be why it looks like the client joins successfully.
If you’re seeing this happen right when you first try to connect, it could be a configuration hiccup or something off with how the token expiration is handled. Could you let me know if this is happening on the very first connection or when you’re trying to reconnect? I’m here to help you figure it out!
Sources:
Authentication | LiveKit Docs |
spec/livekit/token_verifier_spec.rb |
livekit-api/livekit/api/access_token.py