77import { Server , Probot , Context } from 'probot' ;
88import { getPrivateKey } from '@probot/get-private-key' ;
99import * as fs from 'fs-extra' ;
10- import { injectable , inject , decorate } from 'inversify' ;
10+ import { injectable , inject } from 'inversify' ;
1111import { Env } from '../../../src/env' ;
1212import { AppInstallationDB , TracedWorkspaceDB , DBWithTracing , UserDB , WorkspaceDB } from '@gitpod/gitpod-db/lib' ;
1313import * as express from 'express' ;
@@ -32,8 +32,6 @@ import { Options, ApplicationFunctionOptions } from 'probot/lib/types';
3232 * look at those values to begin with.
3333 */
3434
35- decorate ( injectable ( ) , Probot )
36-
3735@injectable ( )
3836export class GithubApp {
3937 @inject ( AppInstallationDB ) protected readonly appInstallationDB : AppInstallationDB ;
@@ -82,6 +80,12 @@ export class GithubApp {
8280 res . redirect ( 301 , this . getBadgeImageURL ( ) ) ;
8381 } ) ;
8482
83+ options . getRouter && options . getRouter ( '/whoami' ) . get ( '/' , async ( req : express . Request , res : express . Response , next : express . NextFunction ) => {
84+ const gh = await app . auth ( ) ;
85+ const data = await gh . apps . getAuthenticated ( ) ;
86+ res . json ( data )
87+ } ) ;
88+
8589 app . on ( 'installation.created' , async ctx => {
8690 const accountId : string = `${ ctx . payload . installation . account . id } ` ;
8791 const installationId = `${ ctx . payload . installation . id } ` ;
0 commit comments