docs: update backend-to-backend auth docs to reflect new TokenManager api

Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
This commit is contained in:
MT Lewis
2021-11-26 12:31:10 +00:00
parent 1cad4e54ca
commit e65d8b5174
+2 -5
View File
@@ -60,12 +60,9 @@ const response = await fetch(pluginBackendApiUrl, {
});
```
You can use the same `tokenManager` to validate tokens supplied on incoming
You can use the same `tokenManager` to authenticate tokens supplied on incoming
requests:
```typescript
const isValidServerToken = await tokenManager.validateToken(token);
if (!isValidServerToken) {
throw new UnauthorizedError();
}
await tokenManager.authenticate(token); // throws if token is invalid
```