Skip to content

Commit 8e06b08

Browse files
committed
feat: remove concurrency from authentication
1 parent 80c508a commit 8e06b08

File tree

5 files changed

+26
-26
lines changed

5 files changed

+26
-26
lines changed

libraries/nestjs-libraries/src/integrations/social/facebook.provider.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ export class FacebookProvider extends SocialAbstract implements SocialProvider {
198198
refresh?: string;
199199
}) {
200200
const getAccessToken = await (
201-
await this.fetch(
201+
await fetch(
202202
'https://graph.facebook.com/v20.0/oauth/access_token' +
203203
`?client_id=${process.env.FACEBOOK_APP_ID}` +
204204
`&redirect_uri=${encodeURIComponent(
@@ -212,7 +212,7 @@ export class FacebookProvider extends SocialAbstract implements SocialProvider {
212212
).json();
213213

214214
const { access_token } = await (
215-
await this.fetch(
215+
await fetch(
216216
'https://graph.facebook.com/v20.0/oauth/access_token' +
217217
'?grant_type=fb_exchange_token' +
218218
`&client_id=${process.env.FACEBOOK_APP_ID}` +
@@ -222,7 +222,7 @@ export class FacebookProvider extends SocialAbstract implements SocialProvider {
222222
).json();
223223

224224
const { data } = await (
225-
await this.fetch(
225+
await fetch(
226226
`https://graph.facebook.com/v20.0/me/permissions?access_token=${access_token}`
227227
)
228228
).json();
@@ -239,7 +239,7 @@ export class FacebookProvider extends SocialAbstract implements SocialProvider {
239239
data: { url },
240240
},
241241
} = await (
242-
await this.fetch(
242+
await fetch(
243243
`https://graph.facebook.com/v20.0/me?fields=id,name,picture&access_token=${access_token}`
244244
)
245245
).json();
@@ -257,7 +257,7 @@ export class FacebookProvider extends SocialAbstract implements SocialProvider {
257257

258258
async pages(accessToken: string) {
259259
const { data } = await (
260-
await this.fetch(
260+
await fetch(
261261
`https://graph.facebook.com/v20.0/me/accounts?fields=id,username,name,picture.type(large)&access_token=${accessToken}`
262262
)
263263
).json();
@@ -275,7 +275,7 @@ export class FacebookProvider extends SocialAbstract implements SocialProvider {
275275
data: { url },
276276
},
277277
} = await (
278-
await this.fetch(
278+
await fetch(
279279
`https://graph.facebook.com/v20.0/${pageId}?fields=username,access_token,name,picture.type(large)&access_token=${accessToken}`
280280
)
281281
).json();

libraries/nestjs-libraries/src/integrations/social/instagram.provider.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ export class InstagramProvider
326326
refresh: string;
327327
}) {
328328
const getAccessToken = await (
329-
await this.fetch(
329+
await fetch(
330330
'https://graph.facebook.com/v20.0/oauth/access_token' +
331331
`?client_id=${process.env.FACEBOOK_APP_ID}` +
332332
`&redirect_uri=${encodeURIComponent(
@@ -340,7 +340,7 @@ export class InstagramProvider
340340
).json();
341341

342342
const { access_token, expires_in, ...all } = await (
343-
await this.fetch(
343+
await fetch(
344344
'https://graph.facebook.com/v20.0/oauth/access_token' +
345345
'?grant_type=fb_exchange_token' +
346346
`&client_id=${process.env.FACEBOOK_APP_ID}` +
@@ -350,7 +350,7 @@ export class InstagramProvider
350350
).json();
351351

352352
const { data } = await (
353-
await this.fetch(
353+
await fetch(
354354
`https://graph.facebook.com/v20.0/me/permissions?access_token=${access_token}`
355355
)
356356
).json();
@@ -367,7 +367,7 @@ export class InstagramProvider
367367
data: { url },
368368
},
369369
} = await (
370-
await this.fetch(
370+
await fetch(
371371
`https://graph.facebook.com/v20.0/me?fields=id,name,picture&access_token=${access_token}`
372372
)
373373
).json();
@@ -419,13 +419,13 @@ export class InstagramProvider
419419
data: { pageId: string; id: string }
420420
) {
421421
const { access_token, ...all } = await (
422-
await this.fetch(
422+
await fetch(
423423
`https://graph.facebook.com/v20.0/${data.pageId}?fields=access_token,name,picture.type(large)&access_token=${accessToken}`
424424
)
425425
).json();
426426

427427
const { id, name, profile_picture_url, username } = await (
428-
await this.fetch(
428+
await fetch(
429429
`https://graph.facebook.com/v20.0/${data.id}?fields=username,name,profile_picture_url&access_token=${accessToken}`
430430
)
431431
).json();

libraries/nestjs-libraries/src/integrations/social/linkedin.provider.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
5454
).json();
5555

5656
const { vanityName } = await (
57-
await this.fetch('https://api.linkedin.com/v2/me', {
57+
await fetch('https://api.linkedin.com/v2/me', {
5858
headers: {
5959
Authorization: `Bearer ${accessToken}`,
6060
},
@@ -66,7 +66,7 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
6666
sub: id,
6767
picture,
6868
} = await (
69-
await this.fetch('https://api.linkedin.com/v2/userinfo', {
69+
await fetch('https://api.linkedin.com/v2/userinfo', {
7070
headers: {
7171
Authorization: `Bearer ${accessToken}`,
7272
},
@@ -122,7 +122,7 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
122122
refresh_token: refreshToken,
123123
scope,
124124
} = await (
125-
await this.fetch('https://www.linkedin.com/oauth/v2/accessToken', {
125+
await fetch('https://www.linkedin.com/oauth/v2/accessToken', {
126126
method: 'POST',
127127
headers: {
128128
'Content-Type': 'application/x-www-form-urlencoded',
@@ -138,15 +138,15 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
138138
sub: id,
139139
picture,
140140
} = await (
141-
await this.fetch('https://api.linkedin.com/v2/userinfo', {
141+
await fetch('https://api.linkedin.com/v2/userinfo', {
142142
headers: {
143143
Authorization: `Bearer ${accessToken}`,
144144
},
145145
})
146146
).json();
147147

148148
const { vanityName } = await (
149-
await this.fetch('https://api.linkedin.com/v2/me', {
149+
await fetch('https://api.linkedin.com/v2/me', {
150150
headers: {
151151
Authorization: `Bearer ${accessToken}`,
152152
},
@@ -174,7 +174,7 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
174174
}
175175

176176
const { elements } = await (
177-
await this.fetch(
177+
await fetch(
178178
`https://api.linkedin.com/v2/organizations?q=vanityName&vanityName=${getCompanyVanity[1]}`,
179179
{
180180
method: 'GET',
@@ -718,7 +718,7 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
718718

719719
override async mention(token: string, data: { query: string }) {
720720
const { elements } = await (
721-
await this.fetch(
721+
await fetch(
722722
`https://api.linkedin.com/v2/organizations?q=vanityName&vanityName=${encodeURIComponent(
723723
data.query
724724
)}&projection=(elements*(id,localizedName,logoV2(original~:playableStreams)))`,

libraries/nestjs-libraries/src/integrations/social/pinterest.provider.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class PinterestProvider
5050

5151
async refreshToken(refreshToken: string): Promise<AuthTokenDetails> {
5252
const { access_token, expires_in } = await (
53-
await this.fetch('https://api.pinterest.com/v5/oauth/token', {
53+
await fetch('https://api.pinterest.com/v5/oauth/token', {
5454
method: 'POST',
5555
headers: {
5656
'Content-Type': 'application/x-www-form-urlencoded',
@@ -68,7 +68,7 @@ export class PinterestProvider
6868
).json();
6969

7070
const { id, profile_image, username } = await (
71-
await this.fetch('https://api.pinterest.com/v5/user_account', {
71+
await fetch('https://api.pinterest.com/v5/user_account', {
7272
method: 'GET',
7373
headers: {
7474
Authorization: `Bearer ${access_token}`,
@@ -108,7 +108,7 @@ export class PinterestProvider
108108
refresh: string;
109109
}) {
110110
const { access_token, refresh_token, expires_in, scope } = await (
111-
await this.fetch('https://api.pinterest.com/v5/oauth/token', {
111+
await fetch('https://api.pinterest.com/v5/oauth/token', {
112112
method: 'POST',
113113
headers: {
114114
'Content-Type': 'application/x-www-form-urlencoded',
@@ -127,7 +127,7 @@ export class PinterestProvider
127127
this.checkScopes(this.scopes, scope);
128128

129129
const { id, profile_image, username } = await (
130-
await this.fetch('https://api.pinterest.com/v5/user_account', {
130+
await fetch('https://api.pinterest.com/v5/user_account', {
131131
method: 'GET',
132132
headers: {
133133
Authorization: `Bearer ${access_token}`,
@@ -148,7 +148,7 @@ export class PinterestProvider
148148

149149
async boards(accessToken: string) {
150150
const { items } = await (
151-
await this.fetch('https://api.pinterest.com/v5/boards', {
151+
await fetch('https://api.pinterest.com/v5/boards', {
152152
method: 'GET',
153153
headers: {
154154
Authorization: `Bearer ${accessToken}`,

libraries/nestjs-libraries/src/integrations/social/tiktok.provider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ export class TiktokProvider extends SocialAbstract implements SocialProvider {
295295
};
296296

297297
const { access_token, refresh_token, scope } = await (
298-
await this.fetch('https://open.tiktokapis.com/v2/oauth/token/', {
298+
await fetch('https://open.tiktokapis.com/v2/oauth/token/', {
299299
headers: {
300300
'Content-Type': 'application/x-www-form-urlencoded',
301301
},
@@ -338,7 +338,7 @@ export class TiktokProvider extends SocialAbstract implements SocialProvider {
338338
const {
339339
data: { max_video_post_duration_sec },
340340
} = await (
341-
await this.fetch(
341+
await fetch(
342342
'https://open.tiktokapis.com/v2/post/publish/creator_info/query/',
343343
{
344344
method: 'POST',

0 commit comments

Comments
 (0)