File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ export async function getCredentials(options: CredentialsOptions): Promise<{ end
37
37
endpoint = `http://127.0.0.1:${ parsed . port ?? 8080 } ` ;
38
38
}
39
39
40
- const aud = parsed . client_auth ?. audience ?. [ 0 ] ?? endpoint ;
40
+ const aud = [ parsed . client_auth ?. audience ?. [ 0 ] , endpoint ] . filter ( ( a ) => a != null ) ;
41
41
42
42
const rawKey = keys [ 0 ] ;
43
43
const key = await jose . importJWK ( rawKey ) ;
@@ -50,7 +50,7 @@ export async function getCredentials(options: CredentialsOptions): Promise<{ end
50
50
. setIssuedAt ( )
51
51
. setIssuer ( 'test-client' )
52
52
. setAudience ( aud )
53
- . setExpirationTime ( '1h ' )
53
+ . setExpirationTime ( '24h ' )
54
54
. sign ( key ) ;
55
55
56
56
return { token, endpoint } ;
Original file line number Diff line number Diff line change @@ -20,7 +20,8 @@ program
20
20
. command ( 'generate-token' )
21
21
. description ( 'Generate a JWT from for a given powersync.yaml config file' )
22
22
. option ( '-c, --config [config]' , 'path to powersync.yaml' )
23
- . option ( '-u, --sub [sub]' , 'sub field for auto-generated token' )
23
+ . option ( '-u, --sub [sub]' , 'payload sub' )
24
+ . option ( '-e, --endpoint [endpoint]' , 'additional payload aud' )
24
25
. action ( async ( options ) => {
25
26
const credentials = await getCredentials ( options ) ;
26
27
const decoded = await jose . decodeJwt ( credentials . token ) ;
You can’t perform that action at this time.
0 commit comments