Skip to content

Commit 7c3ecba

Browse files
committed
issues feedback
1 parent 729c62f commit 7c3ecba

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

articles/communication-services/quickstarts/includes/user-access-token-js.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,15 @@ await identityClient.revokeTokens(userResponse);
123123
console.log(`\nSuccessfully revoked all tokens for user with Id: ${userResponse.communicationUserId}`);
124124
```
125125

126+
## Refresh user access tokens
127+
128+
To refresh a token, use the `CommunicationUser` object to re-issue:
129+
130+
```javascript
131+
let userResponse = new CommunicationUser(existingUserId);
132+
let tokenResponse = await identityClient.issueToken(userResponse, ["voip"]);
133+
```
134+
126135
## Delete a user
127136

128137
Deleting a user revokes all active tokens and prevents you from issuing subsequent tokens for the identities. It also removes all the persisted content associated with the user.

articles/communication-services/quickstarts/voice-video-calling/includes/get-started-javascript.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,10 @@ import { CallClient, CallAgent } from "@azure/communication-calling";
9292
import { AzureCommunicationUserCredential } from '@azure/communication-common';
9393

9494
let call;
95+
let callAgent;
9596
const calleeInput = document.getElementById("callee-id-input");
9697
const callButton = document.getElementById("call-button");
9798
const hangUpButton = document.getElementById("hang-up-button");
98-
99-
// quickstart code goes here
10099
```
101100

102101
## Object model
@@ -115,12 +114,13 @@ The following classes and interfaces handle some of the major features of the Az
115114
You need to replace `<USER_ACCESS_TOKEN>` with a valid user access token for your resource. Refer to the [user access token](../../access-tokens.md) documentation if you don't already have a token available. Using the `CallClient`, initialize a `CallAgent` instance with a `CommunicationUserCredential` which will enable us to make and receive calls. Add the following code to **client.js**:
116115

117116
```javascript
118-
const callClient = new CallClient();
119-
const tokenCredential = new AzureCommunicationUserCredential("<USER ACCESS TOKEN>");
120-
let callAgent;
121-
122-
callAgent = await callClient.createCallAgent(tokenCredential);
123-
callButton.disabled = false;
117+
async function init() {
118+
const callClient = new CallClient();
119+
const tokenCredential = new AzureCommunicationUserCredential("<USER ACCESS TOKEN>");
120+
callAgent = await callClient.createCallAgent(tokenCredential);
121+
callButton.disabled = false;
122+
}
123+
init();
124124
```
125125

126126
## Start a call

0 commit comments

Comments
 (0)