@@ -37,27 +37,27 @@ export class Jwt extends APIResource {
37
37
/**
38
38
* Creates a new token for a license for playing back DRM'd video content
39
39
*/
40
- async signDrmLicense (
41
- playbackId : string ,
42
- config : MuxJWTSignOptions < keyof typeof TypeClaim > = { } ,
43
- ) : Promise < string > {
44
- const claim = TypeClaim [ config . type ?? 'drm_license' ] ;
45
- if ( ! claim ) {
46
- throw new Error ( `Invalid signature type: ${ config . type } ; Expected one of ${ Object . keys ( TypeClaim ) } ` ) ;
47
- }
48
-
49
- const tokenOptions : SignOptions = {
50
- keyid : jwt . getSigningKey ( this . _client , config ) ,
51
- subject : playbackId ,
52
- audience : claim ,
53
- expiresIn : config . expiration ?? '7d' ,
54
- noTimestamp : true ,
55
- algorithm : 'RS256' ,
56
- } ;
57
-
58
- return jwt . sign ( config . params ?? { } , await jwt . getPrivateKey ( this . _client , config ) , tokenOptions ) ;
40
+ async signDrmLicense (
41
+ playbackId : string ,
42
+ config : MuxJWTSignOptions < keyof typeof TypeClaim > = { } ,
43
+ ) : Promise < string > {
44
+ const claim = TypeClaim [ config . type ?? 'drm_license' ] ;
45
+ if ( ! claim ) {
46
+ throw new Error ( `Invalid signature type: ${ config . type } ; Expected one of ${ Object . keys ( TypeClaim ) } ` ) ;
59
47
}
60
48
49
+ const tokenOptions : SignOptions = {
50
+ keyid : jwt . getSigningKey ( this . _client , config ) ,
51
+ subject : playbackId ,
52
+ audience : claim ,
53
+ expiresIn : config . expiration ?? '7d' ,
54
+ noTimestamp : true ,
55
+ algorithm : 'RS256' ,
56
+ } ;
57
+
58
+ return jwt . sign ( config . params ?? { } , await jwt . getPrivateKey ( this . _client , config ) , tokenOptions ) ;
59
+ }
60
+
61
61
/**
62
62
* Creates a new token to be used with a space
63
63
* @deprecated Mux Real-Time Video (spaces) has been shut down. This function will be removed in the next major version.
0 commit comments