text: const passport = require('passport');
  const GoogleStrategy = require('passport-google-oauth20').Strategy;
  const mongoose = require('mongoose');
  
  const User = mongoose.model('users');
  
  passport.serializeUser((user, done) => {
    done(null, user.id);
  });
  
  passport.deserializeUser(async (id, done) => {
    const user = await User.findById(id);
    done(null, user);
  });
  
  passport.use(
    new GoogleStrategy(
      {
        clientID: process.env.GOOGLE_CLIENT_ID,
        clientSecret: process.env.GOOGLE_CLIENT_SECRET,
        callbackURL: process.env.GOOGLE_CALLBACK_URL,
      },
      async (accessToken, refreshToken, profile, done) => {
        const existingUser = await User.findOne({ googleID: profile.id });
        if (existingUser) {
          done(null, existingUser);
        } else {
          const user = await new User({ googleID: profile.id }).save();
          done(null, user);
        }
      },
    ),
  );
  