pass client defined metadata from JWT to participant (#17)

This commit is contained in:
David Zhao
2021-02-10 23:13:36 -08:00
committed by GitHub
parent 38140debdf
commit 538461d5dc
23 changed files with 286 additions and 81 deletions
+3 -3
View File
@@ -62,12 +62,12 @@ func ExpandUser(p string) string {
return p
}
func accessToken(c *cli.Context, grant *auth.VideoGrant, identity string) (value string, err error) {
func accessToken(c *cli.Context, grant *auth.VideoGrant, identity string) *auth.AccessToken {
apiKey := c.String("api-key")
apiSecret := c.String("api-secret")
if apiKey == "" && apiSecret == "" {
// not provided, don't sign request
return
return nil
}
isDev := c.Bool("dev")
@@ -79,5 +79,5 @@ func accessToken(c *cli.Context, grant *auth.VideoGrant, identity string) (value
fmt.Println("creating dev token")
at.SetValidFor(time.Hour * 24 * 30)
}
return at.ToJWT()
return at
}