passport-oauth2 icon indicating copy to clipboard operation
passport-oauth2 copied to clipboard

callback of passport.use do not fetch correctly user emails

Open efremolo opened this issue 6 months ago • 0 comments

the callback function do not fetch the GitHub user emails + do not provide type safety when typed out (need specific casting)

export class GithubAuthenticator {
   constructor(options: StrategyOptions, controller: GithubAuthenticatorProps) {
      passport.use(
         new Strategy(
            options,
            async (
               accessToken: string,
               refreshToken: string,
               profile: Profile // profile.emails DO NOT FETCH,
               done: (err: any, user?: Express.User | false | null) => void,
            ) => {

efremolo avatar Jun 14 '25 15:06 efremolo