MCPcopy Create free account
hub / github.com/mailvelope/mailvelope / getUserInfo

Function getUserInfo

src/modules/gmail.js:324–335  ·  view source on GitHub ↗
(accessToken)

Source from the content-addressed store, hash-verified

322}
323
324async function getUserInfo(accessToken) {
325 const options = {
326 method: 'GET',
327 headers: {
328 Authorization: `Bearer ${accessToken}`,
329 Accept: 'application/json'
330 },
331 contentType: 'json'
332 };
333 const {sub, hd, email} = await fetchJSON('https://www.googleapis.com/oauth2/v3/userinfo', options);
334 return {sub, hd, email};
335}
336
337async function revokeToken(token) {
338 let url = `${GOOGLE_API_HOST}/o/oauth2/revoke`;

Callers 1

authorizeFunction · 0.70

Calls 1

fetchJSONFunction · 0.85

Tested by

no test coverage detected