MCPcopy Create free account
hub / github.com/IQEngine/IQEngine / getAccessToken

Method getAccessToken

client/src/api/utils/Auth-Utils.ts:14–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12 }
13
14 async getAccessToken() {
15 const api_scope = 'api://' + import.meta.env.IQENGINE_APP_ID + '/api';
16 if (!this.account) return null;
17 try {
18 const response = await this.instance.acquireTokenSilent({
19 account: this.account,
20 scopes: [api_scope],
21 });
22 return response.accessToken;
23 } catch (error) {
24 return null;
25 }
26 }
27
28 async requestWithAuthIfRequired(config: AxiosRequestConfig) {
29 const token = await this.getAccessToken();

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected