This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class PassportService { | |
static async authFacebook(accessToken: string, context: IKoaContext) { | |
// seems to be the easiest way to get the facebook token into the auth library | |
// could also be passed as a faked body or query string parameter | |
context.request.header.access_token = accessToken | |
try { | |
let returnUser: any = null; | |
// its easier to use the user returned in a callback than try to promisfiy | |
// this function | |
await Passport.authenticate( |