diff --git a/lib/clients/livekit/token.v b/lib/clients/livekit/token.v index d33e73af..cd593631 100644 --- a/lib/clients/livekit/token.v +++ b/lib/clients/livekit/token.v @@ -11,7 +11,7 @@ import json @[params] pub struct AccessTokenOptions { pub mut: - ttl int | string // TTL in seconds or a time span (e.g., '2d', '5h') + ttl int = 21600// TTL in seconds name string // Display name for the participant identity string // Identity of the user metadata string // Custom metadata to be passed to participants @@ -19,8 +19,6 @@ pub struct AccessTokenOptions { // Constructor for AccessToken pub fn (client Client) new_access_token(options AccessTokenOptions) !AccessToken { - ttl := if options.ttl is int { options.ttl } else { 21600 } // Default TTL of 6 hours (21600 seconds) - return AccessToken{ api_key: client.api_key api_secret: client.api_secret diff --git a/lib/clients/livekit/token_model.v b/lib/clients/livekit/token_model.v index 7c64beda..84a6b352 100644 --- a/lib/clients/livekit/token_model.v +++ b/lib/clients/livekit/token_model.v @@ -39,7 +39,7 @@ pub struct AccessToken { api_secret string grants ClaimGrants identity string - ttl int | string + ttl int } // Method to add a video grant to the token