Hello i have a problem with node / passport and i already checked answers on Stackoverflow but nothing is working for me..

So i m trying to use passport but i have this error :

```
Error: Can't set headers after they are sent.

```

here is my strategy :

```
passport.use('42', new FortyTwoStrategy({
    clientID: configAuth.schoolAuth.clientId,
    clientSecret: configAuth.schoolAuth.clientSecret,
    callbackURL: configAuth.schoolAuth.callbackURL,
}, (accessToken, refreshToken, profile, done) => {
    process.nextTick(() => {
        console.log(1);
            console.log(2);

            User.findOne({ $and: [{ username: profile.username }, { provider: '42' }] }, (err, user) => {
                if (err) return done(err, { status: false, details: 'Cant connect to db' });
                if (!user) {
                    const newUser = new User({
                        id: profile.id,
                        username: profile.username,
                        mail: profile.emails[0].value,
                        image: profile.photos[0].value,
                        provider: '42',
                    });
                    newUser.save((erro) => {
                        if (erro) return done(erro);
                        return done(null, user, { status: true, details: 'success' });
                    });
                } else {
                return done(null, user, { status: true, details: 'success' });
            }
            });
        return (false);
    });
}));

```

My routes: 

```
app.get('/api/user/auth/42', passport.authenticate('42'));

    app.get('/api/user/auth/42/callback', userFonc.schoolLogin);

```

and my callback function :

```
schoolLogin: (req, res, next) => {
            passport.authenticate('42', (err, user) => {
                if (err) return res.send(err);
                if (!user) {
                    return res.send({ status: false, details: 'error occured' });
                }
                const token = jwt.sign({ _id: user._id, username: user.username }, cfg.jwtSecret);
                res.set('Access-Control-Expose-Headers', 'x-access-token');
                res.set('x-access-token', token);
                res.send({ status: 'success', user });
                return res.send(user);
            })(req, res, next);
        },

```

if anyone can explain me why i have this error and how to remove it.. cause i think that my return should work like that..

Thank you