Guest user login code review?

This is my guest user login system and It is work but I think this is not a good way to do this anybody have some good idea how I do this this?

guestLogin: async (req, res, next) => {
        const guestCreadentials = req.body;
        const user = await userModel.findOne({ email:, username: guestCreadentials.username })
        if (!user) return res.status(404).send({
            failure: true,
            msg: "This is server error!"
        const login_user = { email:, password: guestCreadentials.password }
        console.log("saved user: ", login_user)
        passport.authenticate('local', (err, user, info) => {
            if (err) next(err);
            if (!user) return res.status(404).send("User not found")
            req.logIn(user, function (err) {
                if (err) { return next(err); }
                return res.send(user);
        })(req, res, next)

Why do you think this?

How this approach works - when a user login with guest identity, I create a guest session in db when user want to login with real creadentials then I forgot the guest session and allow to create a new account with his/her true identity.
This approach works great and I am able to manage a guest session over the whole application. but I don’t know why I think is there a better way to do this?