({
access_token,
}: {
access_token: string;
})
| 34 | }; |
| 35 | |
| 36 | export const getGithubUser = async ({ |
| 37 | access_token, |
| 38 | }: { |
| 39 | access_token: string; |
| 40 | }): Promise<any> => { |
| 41 | try { |
| 42 | const response = await fetch('https://api.github.com/user',{ |
| 43 | method: 'GET', |
| 44 | headers: { |
| 45 | Authorization: `Bearer ${access_token}`, |
| 46 | }, |
| 47 | } |
| 48 | ); |
| 49 | const data = await response.json() |
| 50 | return data; |
| 51 | } catch (err: any) { |
| 52 | throw Error(err) |
| 53 | } |
| 54 | }; |
no outgoing calls
no test coverage detected