From 173c11f11c48d6f131e5b5bd36b7c9321088d2af Mon Sep 17 00:00:00 2001 From: VikramjeetD <41290641+VikramjeetD@users.noreply.github.com> Date: Wed, 6 May 2020 21:09:39 +0530 Subject: [PATCH] Troubleshoot --- server/routes/api/auth.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/routes/api/auth.js b/server/routes/api/auth.js index 2cda8e2..d0d945e 100644 --- a/server/routes/api/auth.js +++ b/server/routes/api/auth.js @@ -17,14 +17,16 @@ authRouter.get( ); authRouter.get("/loggedin", loggedIn, function (req, res) { + console.log("in loggedin"); if (req.user) { + console.log("loggedin found user"); res.status(200).send(req.user); } else { + console.log("loggedin no user"); res.status(401).json({ msg: "Unauthorized" }); } }); - authRouter.get( "/auth/google/callback", passport.authenticate("google"), @@ -41,9 +43,12 @@ authRouter.get("/logout", (req, res) => { }); authRouter.get("/current_user", loggedIn, (req, res) => { + console.log("currentuser"); if (req.user) { + console.log("currentuser found user"); res.status(200).send(req.user); } else { + console.log("currentuser no find user"); res.status(401).json({ msg: "Unauthorized" }); } });