const logger = require('../logging');
const passport = require('passport');
const { setupOIDC } = require('./oidc');
const { deserializeUser } = require('./user');

module.exports = async (app) => {
  await setupOIDC();

  passport.serializeUser((user, done) => {
    logger.silly('Serializing user', { userId: user.id });
    done(null, user.id);
  });

  passport.deserializeUser(deserializeUser);
  app.use(passport.initialize());
  app.use(passport.session());
  app.get('/login', passport.authenticate('oidc'));
  app.get('/logout', (req, res) => {
    req.logout();
    res.redirect('/');
  });
  app.get('/auth', passport.authenticate('oidc', { successRedirect: '/', failureRedirect: '/' }));
  return app;
};

@@ -1,42 +1,4 @@
-const logger = require('../logging');%0A
 cons
@@ -220,73 +220,8 @@
 ) =%3E
- %7B%0A    logger.silly('Serializing user', %7B userId: user.id %7D);%0A   
  don
@@ -240,17 +240,11 @@
 .id)
-;%0A  %7D
 );%0A
-%0A
   pa

Simplify deserialization call and remove unnecessary logging.