Preserve original expiry when refreshing token (#4580)

To avoid shortening the token expiration time during
refreshing cause client reconnect failed after network
down for a long time (>5min).
This commit is contained in:
cnderrauber
2026-06-10 14:51:10 +08:00
committed by GitHub
parent 8d2b827f44
commit 7dc6877738
10 changed files with 125 additions and 9 deletions
+5
View File
@@ -182,6 +182,7 @@ type ParticipantParams struct {
ReporterResolver roomobs.ParticipantReporterResolver
SimTracks map[uint32]interceptor.SimulcastTrackInfo
Grants *auth.ClaimGrants
TokenExpiresAt time.Time
InitialVersion uint32
ClientConf *livekit.ClientConfiguration
ClientInfo ClientInfo
@@ -781,6 +782,10 @@ func (p *ParticipantImpl) ClaimGrants() *auth.ClaimGrants {
return p.grants.Load()
}
func (p *ParticipantImpl) TokenExpiresAt() time.Time {
return p.params.TokenExpiresAt
}
func (p *ParticipantImpl) SetPermission(permission *livekit.ParticipantPermission) bool {
if permission == nil {
return false