Skip to content

Commit 0c385c0

Browse files
committed
using passportjs to handle auth , added auth with google
1 parent 9baa25e commit 0c385c0

12 files changed

+451
-259
lines changed

images/google.png

37.9 KB
Loading

images/mauriseri.png

55.4 KB
Loading

images/profile.jpg

10.5 KB
Loading

images/wolf.jpg

6.5 KB
Loading

package-lock.json

+132
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
"mongoose": "^8.5.3",
2424
"multer": "^1.4.5-lts.1",
2525
"nodemon": "^3.1.4",
26+
"passport": "^0.7.0",
27+
"passport-google-oauth20": "^2.0.0",
28+
"passport-google-oidc": "^0.1.0",
29+
"passport-local": "^1.0.0",
2630
"react": "^18.3.1",
2731
"react-dom": "^18.3.1",
2832
"react-icons": "^5.3.0",

server/isAuthenticated.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export const isAuthenticated = (req, res, next) => {
2-
if(!req?.session?.isLoggedIn) {
2+
if(!req?.user._id) {
33
return res.status(403).json({message: "not logged in"})
44
}
55
else next()

0 commit comments

Comments
 (0)