//native
/**
* Get Current User
* Get the profile of the connected user: id, display name, email and user principal name. Requires User.Read (a connection default).
*/
export async function main(auth: RT.MsTeams) {
const url = new URL(`https://graph.microsoft.com/v1.0/me`)
const response = await fetch(url, {
headers: {
Authorization: `Bearer ${auth.token}`,
Accept: "application/json",
},
})
if (!response.ok) {
throw new Error(`${response.status} ${await response.text()}`)
}
return await response.json()
}
Submitted by hugo989 2 hours ago