diff --git a/packages/myschoolapp-reporting/src/globals.d.ts b/packages/datadirect-puppeteer/src/BBAuthClient.d.ts similarity index 100% rename from packages/myschoolapp-reporting/src/globals.d.ts rename to packages/datadirect-puppeteer/src/BBAuthClient.d.ts diff --git a/packages/datadirect-puppeteer/src/PuppeteerSession/Authenticated.ts b/packages/datadirect-puppeteer/src/PuppeteerSession/Authenticated.ts index c49882e..6d32082 100644 --- a/packages/datadirect-puppeteer/src/PuppeteerSession/Authenticated.ts +++ b/packages/datadirect-puppeteer/src/PuppeteerSession/Authenticated.ts @@ -87,6 +87,12 @@ export class Authenticated extends Base { ); } + public async user(): Promise { + return await this.page.evaluate( + async () => (await BBAuthClient.BBAuth.getDecodedToken(null)).email + ); + } + public async fork( path: URL | string, timeout = Authenticated.DefaultTimeout