import passport from "passport" ; import { VerifyCallback } from "passport-oauth2" ; import OAuth2Strategy from "./oauth2orize-strategy" ; import _ from "lodash" ; import Client from "../models/OAuth/Client" ; import Clients from "../models/OAuth/ClientCollection" ; import User from "../../client/core/src/models/User" ; const client = Clients [ 0 ] ; passport . use ( "oauth2" , new OAuth2Strategy ( { authorizationURL : `${ client . hostUrl }/oauth2/authorize` , tokenURL : `${ client . hostUrl }/oauth2/token` , clientID : client . id , clientSecret : client . secret , callbackURL : client . redirectUri } , ( accessToken , refreshToken , user , verified ) => { console . log ( "[OAuth2Strategy] applied, accessToken: " + accessToken + " and user: " + JSON . stringify ( user ) ) ; verified ( undefined , user , { accessToken : accessToken } ) ; } ) ) ;