(accessToken)
| 322 | } |
| 323 | |
| 324 | async 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 | |
| 337 | async function revokeToken(token) { |
| 338 | let url = `${GOOGLE_API_HOST}/o/oauth2/revoke`; |