diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | \ | 23 |
2 files changed, 1 insertions, 24 deletions
@@ -9,7 +9,7 @@ /coverage # next.js -/.next/ +# /.next/ /out/ # production @@ -1,23 +0,0 @@ -import dbConnect from 'lib/dbConnect' -import withSession from 'lib/withSession' -import User from 'models/User' - -export default withSession(async (req, res) => { - await dbConnect() - - const user = req.session.get('user') - - if (user) { - const state = await User.state(user._id) - - res.json({ - isLoggedIn: true, - ...user, - ...state - }) - } else { - res.json({ - isLoggedIn: false, - }) - } -}) |