Hello! I am trying to use cloudflare to implement oauth2. I picked passport-google-oauth20 package to implement this + Hono framework. But I faced this error. Does someone have any idea how can I fix it? I thought I can use flag
node_modules/oauth/lib/oauth2.js:3:19:
3 │ https= require('https'),
This is the script of my auth
import { Hono } from 'hono';
import passport from 'passport';
import { Strategy, StrategyOptions, Profile, VerifyCallback } from 'passport-google-oauth20';
const auth = new Hono();
const strategyOptions: StrategyOptions = {
clientID: 'my-client-id',
clientSecret: 'my-secret',
callbackURL: 'http://localhost:3000/google/callback',
};
const verify = (accessToken: string, refreshToken: string, profile: Profile, done: VerifyCallback): void => {
// User.findOrCreate({ googleId: profile.id }, function (err, user) {
// return cb(err, user);
// });
};
passport.use(new Strategy(strategyOptions, verify));
auth.get('google/login', passport.authenticate('google', { scope: ['profile'] }));
auth.get(
'google/callback',
passport.authenticate('google', { failureRedirect: '/login' }, function (req: any, res: any) {
// Successful authentication, redirect home.
res.redirect('/');
})
);
export default auth;