MCPcopy
hub / github.com/parse-community/parse-server / request

Method request

src/Adapters/Auth/twitter.js:183–207  ·  view source on GitHub ↗
(authData, options)

Source from the content-addressed store, hash-verified

181 }
182
183 async request(authData, options) {
184 const { consumer_key, consumer_secret } = options;
185
186 const oauth = {
187 consumer_key,
188 consumer_secret,
189 auth_token: authData.oauth_token,
190 auth_token_secret: authData.oauth_token_secret,
191 };
192
193 const url = new URL('https://api.twitter.com/2/users/me');
194
195 const response = await fetch(url, {
196 headers: {
197 Authorization: 'Bearer ' + oauth.auth_token,
198 },
199 body: JSON.stringify(oauth),
200 });
201
202 if (!response.ok) {
203 throw new Error('Failed to fetch user data.');
204 }
205
206 return response;
207 }
208
209 async beforeFind(authData) {
210 if (this.enableInsecureAuth && !authData?.code) {

Callers 7

validateInsecureAuthMethod · 0.95
httpRequestFunction · 0.80
OAuth1Client.jsFile · 0.80
requestFunction · 0.80
apiRequestFunction · 0.80
postMultipartFunction · 0.80

Calls 1

fetchFunction · 0.50

Tested by 1

postMultipartFunction · 0.64