export interface GoogleUserInfo { email: string email_verified: boolean picture: string sub: string name: string } export async function getGoogleUserInfo( accessToken: string, ): Promise { const response = await fetch( 'https://www.googleapis.com/oauth2/v3/userinfo', { method: 'GET', headers: { Authorization: `Bearer ${accessToken}`, Accept: 'application/json', }, }, ) if (!response.ok) { throw new Error('Network response was not ok') } const data = await response.json() return data as GoogleUserInfo }